Sublime Forum

Goto Definiton should open Preview tabs

#1

Goto Definition is an excellent addition in Sublime Text 3, but when I use it I find I end up with tons of tabs open from using Goto Definition to quickly peek at a method definition, and then using Jump Back to return to where I was working.

Sublime Text’s sidebar offers a ‘Click to Preview’ facility, where clicking a file once in the sidebar opens the file in a preview tab, that closes again when you switch away from it. A preview tab is converted transparently to a full-fledged buffer if you make a change to its contents.

If Goto Definition supported the same functionality, I’d use it; that way only definitions that you opened and then actually made changes to would remain open.

2 Likes

#2

ST does this already.

0 Likes

#3

Are you sure?

With the cursor on a method call, I hit ⌥⌘↓ (Goto Definition). A new tab opens with the cursor on the method definition. If this were a Preview Tab, I’d expect to be able to hit Esc to close the tab and return to the method call. Esc doesn’t do anything at this point. If instead I hit ^- (Jump Back), my cursor is returned to the method call but the tab that was opened by Goto Definition remains open. If it were a Preview Tab, I’d expect that tab to have closed when it lost focus.

Am I doing something wrong?

0 Likes

#4

Ah, I see what you mean now. I thought you were referring to the previews that open when the same symbol is defined in multiple files and a quick panel opens for each, in which case ST does indeed open preview tabs until you press enter.

It always opens a real tab when there is only a single candidate however.

0 Likes