Fixed some issues with the jump list - #1393
Open
jorbakk wants to merge 1 commit into
Open
Conversation
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.
The current implentation of the jump list has some issues, notably the following two:
When changing direction while navigating through the jump list, the mark where the direction is changes is jumped twice. So the cursor is kept on the same mark but it is expected to jump directly to the previous mark.
This can be reproduced by saving three marks in the jump list (in an arbitrary file) on three subsequent lines with:
gsjgsjgsjthen navigate back and forth using a sequence like:
g<g<g>g>when changing direction of navigation,
g>needs to be typed twice before taking any effect.Moving beyond the end of the jump list generates empty, zero-initialized marks that need to be skipped when navigating through them. Creating new and valid jump list entries afterwards leaves empty marks in the list.
To reproduce, store two marks in the jump list:
gsjg>g>g>gsjnow, we need to do 5 times
g<to navigate back to the first mark, instead of having to jump two times only which would be expected in a list of two marks.The patch below is a rewrite of the jump list handling code and should provide a more correct implementation.