Sublime Forum

How have GoTo Definition use an already open file if it is open?

#1

In my experience, the Goto Definition command/function (available either through the Hover over or through the “Goto” menu and the keybinding for that command) … will always open a new buffer for the location of the definition … even when that file is already open in another group.

I like my groups and am comfortable manipulating/navigating them (thanks mostly to the Origami package … and I often have my files organised in a logical manner such that a definition is likely to be in a file in another group from its use/call/reference.

Having a definition open in an already buffer would be much more useful, or at least having some control over it.

I haven’t found a way to handle this. The LSP plugin seems to have a means of managing this (see this GitHub Issue #1994. Anyone have any thoughts?

1 Like

#2

Actually, there appears to an open issue about this here, (#813).

There is also an apparent fix offered there (see here and here) that involves rewriting the Default/symbol.py file … Yikes!

Hopefully something nicer is in the works. With the LSP argument you can easily have control and two keybindings for the different behaviours.

1 Like