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

Do not revert to a single cursor when escape is pressed after a block selection #8510

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lord
Copy link

@lord lord commented Jul 21, 2023

What this PR does / why we need it:
Previously, if you created a multicursor block selection, pressed I, and then pressed escape, all selections except the first would be deleted. This change updates the escape behavior to preserve these selections.

I've also added tests that confirm this behavior is fixed, and confirmed running the tests without the fix makes them fail.

I'll admit I don't perfectly understand the purpose of isFakeMultiCursor, but I'm absolutely willing to put time into changes or improvements as suggested by a reviewer.

Which issue(s) this PR fixes
Fixes #8147
Fixes #7008

Special notes for your reviewer:
n/a

@J-Fields
Copy link
Member

I'll admit I don't perfectly understand the purpose of isFakeMultiCursor, but I'm absolutely willing to put time into changes or improvements as suggested by a reviewer.

I think the context is this: vanilla Vim doesn't support multicursor, but some actions had effects that sort of mimicked it (like insertion from VisualBlock mode, as this PR relates to). Changing these to be real multi-cursor interactions is much nicer, of course, but this breaks Vim compatibility slightly, as one <Esc> won't take you from multi-cursor Insert to single-cursor Normal. isFakeMultiCursor tracks these situations so one <Esc> will also collapse the cursors.

I do wonder if all this isn't nitpicky bullshit that we can just do away with.

@lord
Copy link
Author

lord commented Aug 29, 2023

I could add a configuration option that defaults to getting rid of isFakeMultiCursor. That way users who expect and depend on the old behavior would instantly see it break, and, if they complain, we can mention this configuration option as a way to get back to the old behavior. If they don't complain, then it's unlikely folks are dependent on this old behavior, and we can get rid of it?

@musjj
Copy link

musjj commented Apr 23, 2024

Any progress with this PR? Adding a configuration seems like a good idea to me.

@musjj
Copy link

musjj commented Apr 24, 2024

Also, another behavior I'm noticing: when deleting in a block selection (e.g. <C-v>jjjdf), the multi cursors will revert to a single cursor. Can we also add an option for this too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants