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

Improve multicursor support #4570

Merged
merged 7 commits into from
Mar 27, 2020
Merged

Conversation

cvaldev
Copy link
Contributor

@cvaldev cvaldev commented Feb 20, 2020

What this PR does / why we need it:
It fixes multicursor snippets, and adds support for stuff like auto-bracketing and auto-completion on multicursor mode.

5fd59f7: (Backspace Support)
Makes range represent the selection at position. This way we delete the correct range rather than the primary selection as it was before these changes.

59496be: (Multicursor Character Insert)
Makes multicursor text insertion behave like single cursor text insertion by ultimately using the default: type command rather than vscode.TextEditor.insert() which doesn't have support for snippet mode, auto completion, bracketing, etc.

To accomplish this, I've added an optional property (isMultiCursor) to InsertTextVSCodeTransformation which represents vimState.isMultiCursorat the time the transformation was created. This property is used to filter the multicursor transformations into multicursorTextTransformations.

Because the default: type command handles inserting the text into the correct cursor positions there's no need to repeat the transformation multiple times and we can just execute the command once, as long as we know all transformations are trying to do the same thing.

Which issue(s) this PR fixes
Fixes #4281
Fixes #4223
Fixes #3005
Fixes #4522
Fixes #4515
Fixes #1946
fix #3976

Special notes for your reviewer:
Is there a way to programmatically test this stuff?... I've pretty much just done a bunch of manual testing, and it all seems to work fine. Let me know what you think, I'd be happy to keep working on it.

@cvaldev cvaldev changed the title Fix multicursor snippets Improve multicursor support Feb 20, 2020
@J-Fields
Copy link
Member

Is there a way to programmatically test this stuff?

Not easily. I've filed #4582, which I'll try to get to soon

@J-Fields J-Fields added this to the v1.13.0 milestone Feb 25, 2020
@J-Fields J-Fields modified the milestones: v1.13.0, 1.14.0 Mar 24, 2020
@J-Fields
Copy link
Member

I'm guessing this would also fix #3976?

@J-Fields
Copy link
Member

Sorry for the merge conflicts, by the way. Once those are resolved and I get the chance to play around with this a bit, we can merge it in. I'm focusing this release on getting multi-cursor to "just work" as much as possible, and this'll be a huge help. I'm going to write a whole bunch of tests once #4583 is done, so no need right now.

@J-Fields J-Fields merged commit 98f3242 into VSCodeVim:master Mar 27, 2020
@J-Fields J-Fields removed this from the v1.15.0 milestone May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment