vim: Keep multi-cursor on escape (#8464)

Release Notes:

- vim: Preserve multiple selections when returning to normal mode.

/cc @mrnugget
This commit is contained in:
Conrad Irwin 2024-02-26 22:54:02 -07:00 committed by GitHub
parent f3fa3b910a
commit 8fc2431a2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 23 deletions

View file

@ -16,7 +16,7 @@ fn normal_before(_: &mut Workspace, action: &NormalBefore, cx: &mut ViewContext<
vim.stop_recording_immediately(action.boxed_clone());
if count <= 1 || vim.workspace_state.replaying {
vim.update_active_editor(cx, |_, editor, cx| {
editor.cancel(&Default::default(), cx);
editor.dismiss_menus_and_popups(cx);
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
s.move_cursors_with(|map, mut cursor, _| {
*cursor.column_mut() = cursor.column().saturating_sub(1);