{{ message }}
Normalize end of line cursor move operation - #296712
Merged
Alexandru Dima (alexdima) merged 3 commits intoAug 24, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Normalizes right-cursor movement at wrapped-line boundaries to select the next visual line’s equivalent position.
Changes:
- Applies right affinity after calculating the next cursor position.
Show a summary per file
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alexandru Dima (alexdima)
approved these changes
Aug 21, 2026
Alexandru Dima (alexdima)
left a comment
Member
There was a problem hiding this comment.
Thank you! ❤️
Alexandru Dima (alexdima)
enabled auto-merge (squash)
August 24, 2026 12:20
Sandeep Somavarapu (sandy081)
approved these changes
Aug 24, 2026
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.

When a line is wrapped, there are two view model positions that represent the same text model position. To illustrate, say we have the line
text edit. We can represent it like this, where|represents the cursor position.If we break it in the view model, it looks like this:
Both positions 1.5 and 2.0 represent the same text position. I did some testing on cursor behaviour, and found inconsistent behaviour across several editors:
However, one specific thing is consistent across all editors I tried: If the cursor is at position 1.4, and you press the right arrow key, all editors move the cursor to position 2.0. I found this behaviour regardless of whether the line is split on whitespace or something else. Only Monaco moves the cursor to position 1.5.
This change makes Monaco behaviour consistent with other editors. I recorded two videos, one before, and one after, where I move the cursor to a line, and slowly keep pressing the right arrow key.
Before:
simplescreenrecorder-2026-02-21_11.08.11.webm
After:
simplescreenrecorder-2026-02-21_11.07.26.webm