-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: [WIP] Add support for editor tab reordering #2372
Conversation
Yes, more tabs ! 😄 👍 for dynamic tabs (realtime moving while dragging), it's more obvious to see what happens. |
This is fantastic!!! Thanks a lot for working on it! :-) My opinions about your todos:
|
Yes, please. Let's leave new things for further PRs ;-) |
It's not a new thing, it's an old thing :) |
I know, but right now I'm not so sure if the best thing is to preserve the previous behavior, and doing so by adding (yet another) option to our crowded Preferences. But instead of discussing that here, I'd prefer to do it in another PR, so I can review and merge this one quickly :-) |
Well.. the thing is, in this PR I commented the lines were sorting took place, so right now the option in preferences does nothing, and I would rather comment it (than erase it) so we can focus on things and move on. It would be weird to merge this PR but leave the option there. |
You agree on the grabbing hand icon (ClosedHand) when dragging? Or any other suggestion from here |
Yes, I'd like to see the CloseHand icon when dragging. |
@ccordoba12 I think I solved the issue you commented, but there is still another one that is quite annoying. If you have many tabs open and the scrolling buttons are there, if you click on file closer to the left, the whole tabs will shift and put the current clicked tab to the right... very weird behavior... |
Sorry for my previous comment, I was just nitpicking. I agree that the option should be removed for now (and it should be added to the context menu for tabs, this is the case where it makes sense). |
The code in editor.py gives me headaches... |
hmmm I think it is a Qt limitation (https://bugreports.qt.io/browse/QTBUG-2360?jql=text%20~%20%22QTabBar%20Scroll%22) that when you setCurrentIndex for a specific tab, if many tabs (and a scroll buttons present) it will always slide the selected tab to the right of the QTabBar, instead of just selecting the tab where it is. This leads to weird behaviors when moving tabs... so the best to have here would be shortcuts to move tabs (Ctrl+Shift+PgUp/PgDn) |
fpsorting_box = newcb(_("Sort files according to full path"), | ||
'fullpath_sorting') | ||
# fpsorting_box = newcb(_("Sort files according to full path"), | ||
# 'fullpath_sorting') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this was a current option? Then we should remove it in this PR because our decision is to order files according to their opening order.
Your video examples are really cool! I don't like the second part very much, not having the tab on the right or left end when scrolling is disturbing. The way Firefox does it is more intuitive for me: basically, you have to put the mouse pointer outside the tabbbar, then it scrolls at a given speed (faster if the mouse is further on the side). |
@Nodd I do not understand this "not having the tab on the right or left end when scrolling is disturbing". What you suggest is harder to implement right due to the way the tabbar is designed |
@Nodd I just checked with Firefox... I do not like it so much cause it is too fast, the user has no real control... |
es the speed is a bit too fast (I think it's needed with lots of tabs: you scroll a bit too much, the you go back 2 or 3 tabs without scrolling), but I find the principle better. |
I tried the firefox approach first, but I could not come up with reliable code .. then I asked the question, then I figured doing it how I did it in the video. But now I have more tools so I can revisit the firefox version.... |
@Nodd I got it to work more like firefox (not as fast!), it is not 100% perfect (I need to look why...), but it is looking good :-) |
Nice ! |
question @ccordoba12 ... So I have a new set of classes that will replace the existing ones so that we have an uniform support for tab handling. But the change will include modifications to the consoles and other parts of spyder (where Tabs are used), so... should I add the new classes with the existing ones and make it work only with the editor in the meantime, and in another PR I adapt the consoles to use the new classes, (and hence erase the old classes) I guess it would make this PR more manageable, and avoid breaking something |
Yes, I agree with your plan. First use the new classes only to fix the problems we have in the Editor. Then (in another PR) use them to improve things in our consoles. May I ask what's exactly the difference between your new classes and the old ones? |
The actual scheme has
I will create a new This will also allow to completely delegate the tab reordering behavior to |
Thanks for the explanation! Sounds really good, please proceed :-) |
@ben1983 thanks for the input. Have you tried using the outline explorer for what you suggest?, the outline explorer displays all the opened (if you enable the functionality) files. The feature requested will not be implemented on this pull request, but I will take note of it. Cheers |
@goanpeca Thank you for the quick response. Yes, I am using the outline explorer. The problems with the outline explorer are:
|
This needs a rebase, and I think it's really important to finish it :-) |
What about this issue? It's pretty old, and it would be nice to have this features... Thanks. |
Closing because @goanpeca has a different approach to solve this. It'll be fixed in 3.1 ;-) |
Description
Any reordering event will reorder ALL editorstacks opened, so everything remains in sync. Since the editor was sorting by default, I disabled all instances were this was happenning, now we need to discuss what other options should we offer, including sorting and also extra ones (Delete tabs to the right, to the left, delete all tabs except this etc...)
My take on this is that new files should be opened in the order of opening (what happens now with this PR) and if the user wants to order them by some measure, it should be an active action from the user in the context menu.
The video
Todo
For another PR