dense-analysis / dense-analysis/ale

Only jump the window that called ALEGoToDefinition

Open
#2,881 1 comment 0 reactions 0 assignees View on GitHub
enhancement LSP
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

My binding to `ALEGoToDefinition` is `gd`.
Native VIM bindings for splitting windows are `v` and `s`.
Therefore instead of `ALEGoToDefinitionIn...Split` I prefer to hit `vgd` or `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 `vgd` to `ALEGoToDefinitionInVSplit` but then:
1. VIM waits each time I split windows to check if I want to add `gd`
2. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.