Only jump the window that called ALEGoToDefinition
My binding to ALEGoToDefinition is gd.
Native VIM bindings for splitting windows are <c-w>v and <c-w>s.
Therefore instead of ALEGoToDefinitionIn...Split I prefer to hit <c-w>vgd or <c-w>sgd.
Currently it has one issue, though. If I open a split on the right, call ALEGoToDefinition and then go back left to work some more in the original window, I'll get redirected to the definition as soon as the language server responds and it'll happen in the current (left) window. I'd much prefer ALEGoToDefinition to remember it was called from the right window and only make the jump there - without interrupting my work. For that to work it can't steal focus during jump either.
I tried to map <c-w>vgd to ALEGoToDefinitionInVSplit but then:
- VIM waits each time I split windows to check if I want to add
gd - ALE steals focus when opening new split anyway
Making ALEGoToDefinitionIn...Split prevent focus stealing would require extra options in configuration, as not everyone might like that, while making ALEGoToDefinition remember the correct window can be a default behaviour, I think.
My response to all of that is, "Yes."
I think I see what you mean. I don't this is too big of an issue, as language servers should hopefully respond so quickly that you won't see this kind of issue much on average. The easiest way to improve this would be to just record the window number that requested going to the definition, and then either eventually open the buffer in that same window, ignore the results and do nothing, or open the buffer in an entirely new window.