diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json index dedc05c612..4dbc4ce17f 100644 --- a/assets/keymaps/vim.json +++ b/assets/keymaps/vim.json @@ -568,7 +568,7 @@ } }, { - "context": "Editor && vim_mode == insert && !menu", + "context": "Editor && vim_mode == insert", "bindings": { "escape": "vim::NormalBefore", "ctrl-c": "vim::NormalBefore", diff --git a/crates/vim/src/insert.rs b/crates/vim/src/insert.rs index fb567fab6a..ec2b8b50c9 100644 --- a/crates/vim/src/insert.rs +++ b/crates/vim/src/insert.rs @@ -16,6 +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.change_selections(Some(Autoscroll::fit()), cx, |s| { s.move_cursors_with(|map, mut cursor, _| { *cursor.column_mut() = cursor.column().saturating_sub(1);