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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/actions/commands/insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export class CommandEscInsertMode extends BaseCommand {
}

if (vimState.isFakeMultiCursor) {
vimState.cursors = [vimState.cursors[0]];
vimState.isFakeMultiCursor = false;
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/multicursor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,18 @@ suite('Multicursor selections', () => {
keysPressed: 'gbgb<Esc>Vjjj<Esc><Esc>gg afd',
end: ['| is a test', '1', '2', 'this is another test', '1', '2', '3', '4', '5'],
});

newTest({
title: 'Multiple cursors are preserved after inserting before a block selection and then pressing escape once',
start: ['|testing', 'testing'],
keysPressed: 'gbgbI<Esc>ifoo',
end: ['foo|testing', 'footesting'],
});

newTest({
title: 'Multiple cursors are truncated to one cursor if you press escape twice',
start: ['|testing', 'testing'],
keysPressed: 'gbgbI<Esc><Esc>ifoo',
end: ['foo|testing', 'testing'],
});
});