Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Escape returns to normal mode even if completion is open

Conrad Irwin2cb320e2463c
diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json
index dedc05c612e..4dbc4ce17f4 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 fb567fab6a7..ec2b8b50c90 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);