Sublime Forum

Close document = prev in stack

#1

This may not be working how I want because of my settings, so sorry if I’m asking for something that’s already in.

Basically, I’ve remapped my keyboard shortcuts so that ctrl+tab/ctrl+shift+tab act like next/prev (visual) tab. The stack thing was seriously getting to me, as I was dipping in and out of files and the stack order thing didn’t make a lot of sense to me. However, I do think that on closing a tab, going back to the previous tab I the stack (rather than the tab to the left of the one you just closed) makes a lot of sense.

Use case: I have 5 tabs open. I’m on tab #3, and realise I quickly need to change something in a non-open file. I press ctrl+p and type in the file name (or double click it from the sidebar). The file opens in a new tab at the end of the tabbar (tab #6). I do the change, save, and then ctrl+w to close. Now I’m on tab #5. I should be back on tab #3.

The alternative there is to open the new tab next to the current one, like what happens if I drag a file in from outside the editor. In fact that’s probably the better idea and it may even be a bugfix…?

0 Likes

#2

I’ve got a lonely 0-vote post for this on UserEcho: sublimetext.userecho.com/topic/4 … the-stack/

0 Likes

#3

I agree. Now you have a lonely 1-vote post on UserEcho.

0 Likes

#4

[quote=“jbjornson”]

I agree. Now you have a lonely 1-vote post on UserEcho.[/quote]

Make that 2 votes. Sorry, I thought it was such a small bug/feature that I didn’t even bother checking the UserEcho list.

0 Likes

#5

This feature made it into 2101! Excellent.

0 Likes

#6

Indeed, this is great stuff!

However, I’ve left a comment in the 2101 thread saying that it’d actually be nice to have it for any closing of a file, not just on using a keybinding. Seems more normal to me.

0 Likes

#7

Is there a way to revert this behaviour? I.e. On close file I want to go to tab on the left of the closed file like in any web browser.

0 Likes

#8

I opened an Issue for this:
github.com/SublimeTextIssues/Core/issues/455

I also describe a solution using an EventListener there.

0 Likes