Fix(VIM-2778) Remove override of editor scroll setting #550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, IdeaVim would enable the "refrain from scrolling" setting in each editor. This appears to be historical, as all IdeaVim scrolling is explicit and to an exact location. This setting now only affects the scroll location when IntelliJ navigates, such as with Go To Member when the target is already visible.
The default setting is "keep the caret in place, scroll editor canvas" (refrain from scrolling disabled - hooray for double negatives!), which will scroll the editor and place the caret about 1/3rd of the way down the editor. IdeaVim would previously override this to "move caret, minimise editor scrolling", which will move the caret without scrolling if the target is already visible.
Even though this overridden behaviour is more Vim-like (Vim prefers to move the caret if the target is visible, and scroll to centre otherwise - see
gv
), this setting does not affect IdeaVim navigation, and only applies to IntelliJ navigation.This fixes VIM-2778, so the Find Usages preview window will now correctly use the setting.
This PR also replaces non-exact scrolling (
scrollTo(CENTER)
) in thegv
handlers. The defaultscrollCaretIntoView
behaviour is more Vim-like, and will scroll only if necessary. This removes some unnecessary code fromVimEditor
.