Keep cursor position on screen when opening/closing lists#2632
Merged
Conversation
# Conflicts: # autoload/ale/list.vim
w0rp
requested changes
Jul 30, 2019
Member
w0rp
left a comment
There was a problem hiding this comment.
I think this is a good idea. I think this can just be on always when opening and closing windows.
w0rp
approved these changes
Aug 17, 2019
Member
|
Sorry for the delay. Cheers! 🍻 |
suoto
added a commit
to suoto/ale
that referenced
this pull request
Sep 11, 2019
…lysis#2632) * Trying to keep win view from bouncing * Adjusting when views are saved and restored * Also restore view when closing quickfix * Don't restore view when opening list vertically
timlag1305
pushed a commit
to timlag1305/ale
that referenced
this pull request
Nov 5, 2019
…lysis#2632) * Trying to keep win view from bouncing * Adjusting when views are saved and restored * Also restore view when closing quickfix * Don't restore view when opening list vertically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2623
Since linter's results are published asynchronously, both location and quickfix lists can open or close during an edit. As of now, the cursor line will move around a bit to accommodate that, which makes very difficult to continue typing, especially if there's multiple linters with varying execution times running (window will bounce in and out quicker).
This PR should wrap opening and closing both location and quickfix lists with
winsaveview()before andwinrestview()after, restoring the topmost line, so that the line currently being edited doesn't jump around the screen.