Fix cursor drift when a wrapped line starts on an exact wrap boundary - #2084
Open
gyanu2507 wants to merge 1 commit into
Open
Fix cursor drift when a wrapped line starts on an exact wrap boundary#2084gyanu2507 wants to merge 1 commit into
gyanu2507 wants to merge 1 commit into
Conversation
…dary. get_height_for_line treated text that fills the width exactly as still on the current row. The cursor is already on the next visual line in that case, which is how a leading wrapped space made it look like it had drifted.
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.
With
wrap_lines=True,get_height_for_linetreated text that fills the window width exactly as still sitting on the current row._scroll_when_linewrappingmeasures the text before the cursor, so an exact fill means the cursor is already on the next visual row. The window then under-scrolls, the wrapped cursor cell is never painted, and it looks like the cursor drifted — usually when a space becomes the first character of a wrapped line. Arrow keys recalculate the position and snap it back.This counts that extra row when measuring up to the cursor (both the fast path and the
get_line_prefixpath).Fixes #2071