Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multi cursor copy line n times (#40646) #52645

merged 3 commits into from Feb 4, 2020


Copy link

padamczewski commented Jun 21, 2018

This commit introduces filtering of current selections for copy line actions

Current behaviour: When multiple cursors are being added to single line on copy line action the content of a line is being duplicated. The amount of copied lines is equal to the number of cursors in line that is being copied.

Current behaviour

After filtering: selections array is filtered before running CopyLinesCommand to avoid the duplication.

After filtering

Unfortunately for now the Selections after the copy action are not predictable and showing in not expected places as I wasn't able to figure out yet how to use editor.setSelection or editor.setSelections properly.
Also it would be good to agree on expected behaviour for the copy actions with multiple selectors so some test around it could be created as well.

I would appreciate any advice and links relevant to setting the position of multiple cursors.
I was thinking of looping over the selections array after the executeCommands will finish running and set the position to line below the initial selection, but not sure if that's best way to approach this.

@alexdima alexdima force-pushed the padamczewski:fix/40646 branch to b7ce554 Feb 19, 2019
alexdima added 2 commits Feb 4, 2020
@alexdima alexdima added this to the February 2020 milestone Feb 4, 2020

This comment has been minimized.

Copy link

alexdima commented Feb 4, 2020

Thank you!

@alexdima alexdima merged commit 3a3ce52 into microsoft:master Feb 4, 2020
4 of 5 checks passed
4 of 5 checks passed
VS Code in progress
license/cla All CLA requirements met.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.