Track document changes in the jumplist #3592
Closed
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, the jumplist was not updated by changes to the document. This meant that the jumplist entries were prone to being incorrect after some edits and that usages of the jumplist were prone to panics if, for example, some edits truncated the document.
This change applies
Transaction
s (document edits) to the selections stored in any jumplists.Implementation-wise I used a
Rc<RefCell<Selection>>
so that theDocument
could edit the selections when applying transactions and then theView
could use the updated selections for jumping. Kakoune does this by waiting to apply transactions untilC-o
/C-i
are used. I would prefer to do all of that work incrementally though since we have the jumplist picker (we would need to update all selections with all changes since the jumps were saved which seems like it could be a lot of work).Closes #3550
Closes #2489