Escape returns to normal mode even if completion is open

For zed-industries/community#1746
This commit is contained in:
Conrad Irwin 2023-09-27 21:28:30 -06:00
parent 73fc1c1c56
commit 2cb320e246
2 changed files with 2 additions and 1 deletions

View File

@ -568,7 +568,7 @@
}
},
{
"context": "Editor && vim_mode == insert && !menu",
"context": "Editor && vim_mode == insert",
"bindings": {
"escape": "vim::NormalBefore",
"ctrl-c": "vim::NormalBefore",

View File

@ -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);