If I open a new file temporarily to look at something and then close it immediately, the new file will open on a tab on the right of the current one, and when I close it Geany will focus on the tab on the right of this one, not on the one I originally had open which is the one on the left. This could be solved if Geany defaulted to moving to the tab on the **left** when I close the currently active tab, instead of the tab on the right as it does now.
(This is assuming the user has their preferences set to "Open new tabs on the right of the current tab"; if they set them to open new tabs on the left, then the behavior should be mirrored and Geany should switch to the tab on the right.)
Alternatively, it could simply switch to the last open tab (emulating the behavior of Ctrl-Tab).
IIRC someone commented somewhere that the behaviour mirrors what browsers do.
Odd. I could have sworn that Firefox used to just do the "switch to the last active tab" thing, but I just tried it and it doesn't do it anymore. In any case, I'd say this depends a lot on the browser since each one does a completely different thing where it comes to switching tabs. (Like how Ctrl-tab works on Chrome and new Firefox vs Geany and old Firefox, for instance.) Plus browsers are sort of crazy, so I don't think mimicking their behavior is necessarily a good idea.
Anyway, I would say that usability takes precedence over "feels like what some other program does", and I believe that my proposal improves usability since when you close a tab you're more likely to want to go to the tab on the left (or to the last open tab).
Plus browsers are sort of crazy, so I don't think mimicking their behavior is necessarily a good idea.
+1, I just tried Chrome, sometimes it went to previous, sometimes to the one on the right, I can't tell what makes the decision.
I think (without checking) in Geany it is simply that since notebook tabs are usually referenced by number counting from left, when the current tab is closed and the tab number isn't changed the tab that was on the right will now be that number and so the current one. So maybe there isn't any code for this, its simply what happens.
Alternatively, it could simply switch to the last open tab (emulating the behavior of Ctrl-Tab).
*Preferences → Interface → Notebook tabs → Editor tabs → Switch to lasted used document after closing a tab* :wink:
_Preferences → Interface → Notebook tabs → Editor tabs → Switch to lasted used document after closing a tab_ 😉
...I swear that option wasn't there when I checked before! 😓
OK, I suppose this can be closed then. (Unless you want to reconsider the default behavior when this option is not enabled.)
Closed #3855 as completed.
github-comments@lists.geany.org