This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
Autoscroll to cursor on undo - #2851
Merged
Merged
Conversation
Fixes #2815 This commit changes our autoscroll strategy for cursors significantly. Originally, we were autoscrolling whenever the cursor's marker changed positions. This worked well, except we didn't end up autoscrolling when the user *attempted* to move the cursor to an invalid position, such as moving down at the end of the buffer, due to the fact that the marker wouldn't change. Then, we moved to always requesting an autoscroll whenever a position change was requested via Cursor::changePosition. This missed out on moving the cursor when inserting text, so we then also added an explicit autoscroll call when inserting text. This had the problem of not autoscrolling due to undo. So finally, this solution combines explicit autoscroll in ::changePosition to capture intent, as well as implicit autoscrolling whenever the cursor's marker position changes due to a textual change in the buffer. This captures undo/redo correctly.
nathansobo
pushed a commit
that referenced
this pull request
Jul 7, 2014
Autoscroll to cursor on undo
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #2815
This commit changes our autoscroll strategy for cursors significantly.
Originally, we were autoscrolling whenever the cursor's marker changed
positions. This worked well, except we didn't end up autoscrolling when
the user attempted to move the cursor to an invalid position, such as
moving down at the end of the buffer, due to the fact that the marker
wouldn't change.
Then, we moved to always requesting an autoscroll whenever a position
change was requested via Cursor::changePosition. This missed out on
moving the cursor when inserting text, so we then also added an explicit
autoscroll call when inserting text.
This had the problem of not autoscrolling due to undo. So finally, this
solution combines explicit autoscroll in ::changePosition to capture
intent, as well as implicit autoscrolling whenever the cursor's marker
position changes due to a textual change in the buffer. This captures
undo/redo correctly.