Remove editor::Cancel binding from vim

When you hit <escape> in the command palette, it first editor::Cancel
because the command palette is also a focused editor; this binding was
catching before the `menu::Cancel` that you probably want.

From looking at the uses of editor::Cancel it seems like the only way to
trigger this is with <escape> in an editor. Rather than trying to hook
into the existing editor cancel and add vim-specific behaviour, we'll
instead take responsibility for binding directly to <escape> when
necessary.

Fixes: zed-industries/community#1347
This commit is contained in:
Conrad Irwin
2023-07-03 15:26:39 -06:00
parent fe57e04016
commit 0733e8d50f
4 changed files with 26 additions and 23 deletions
+8 -2
View File
@@ -93,7 +93,10 @@
],
"ctrl-o": "pane::GoBack",
"ctrl-]": "editor::GoToDefinition",
"escape": "editor::Cancel",
"escape": [
"vim::SwitchMode",
"Normal"
],
"0": "vim::StartOfLine", // When no number operator present, use start of line motion
"1": [
"vim::Number",
@@ -325,7 +328,10 @@
"bindings": {
"tab": "vim::Tab",
"enter": "vim::Enter",
"escape": "editor::Cancel"
"escape": [
"vim::SwitchMode",
"Normal"
]
}
}
]