fix copy with multiple cursors and empty selections#256083
Merged
alexdima merged 5 commits intomicrosoft:mainfrom Dec 18, 2025
Merged
fix copy with multiple cursors and empty selections#256083alexdima merged 5 commits intomicrosoft:mainfrom
alexdima merged 5 commits intomicrosoft:mainfrom
Conversation
Contributor
Author
|
@alexdima I think your unit tests in |
Contributor
Author
|
@microsoft-github-policy-service agree |
alexdima
approved these changes
Dec 17, 2025
rzhao271
approved these changes
Dec 17, 2025
Contributor
Author
|
Should I be the one to merge it (I would guess not) |
Contributor
Author
I don't see the button anywhere, so I'll leave it to you. |
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.
When having
emptySelectionClipboard: true,and when you have multiple cursors and all of them are empty,
and when we copy,
each cursor should copy its own line.
Fixes: #256039
There is a room for improvement: mainly, when pasting, VSCode pastes at the cursor position, not in the line above (like it does with just one cursor and copying of the empty selection).
(reference 1 (for later))
Testing:
emptySelectionClipboard: truein settingsCurrently, it copies
"a\nb\n"in both places:It should produce
But because aforementioned issue (reference 1), it produces
Which is good enough (and better than what we currently have).
Though, this can be easily avoided by, before Pasting, setting cursors at the beginning of the lines:
And then Paste correctly produces