Do not revert to a single cursor when escape is pressed after a block selection
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
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.
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?
Any progress with this PR? Adding a configuration seems like a good idea to me.
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?