[diffs/edit] Add Alt/Option-drag column and rectangular selections - #1071
[diffs/edit] Add Alt/Option-drag column and rectangular selections#1071ije wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 648ce794b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const characterDelta = | ||
| characterDeltaRaw < 0 | ||
| ? -Math.round(-characterDeltaRaw) | ||
| : Math.round(characterDeltaRaw); | ||
| const focusCharacter = Math.max(0, anchor.character + characterDelta); |
There was a problem hiding this comment.
Snap Alt-drag offsets to grapheme boundaries
When Alt/Option-drag synthesizes focusCharacter from the pointer delta, it stores that raw UTF-16 offset directly in every generated selection. For lines containing emoji or combining-character graphemes, the rounded offset can land inside a grapheme; subsequent typing, delete, copy/cut, or replacement uses textDocument.offsetAt() on that unsnapped position and can split/corrupt the character. The vertical cursor path already snaps real landings out of graphemes, so this rectangular-selection path should do the same per affected line before calling #updateSelections.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Alt-drag now snaps both synthesized endpoints per line before creating selections, using the shared grapheme-boundary helper.
Add
Alt/Option-dragsupport for column-aligned and rectangular multi-selections.Screen.Recording.2026-08-11.at.01.11.17.mov