vim: Fix renaming (#7714)

This was broken by #7647

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-02-12 22:28:26 -07:00 committed by GitHub
parent 04fc0dde1a
commit a1899bac4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 68 additions and 24 deletions

View file

@ -198,7 +198,7 @@ impl Vim {
}
fn activate_editor(&mut self, editor: View<Editor>, cx: &mut WindowContext) {
if editor.read(cx).mode() != EditorMode::Full {
if !editor.read(cx).use_modal_editing() {
return;
}
@ -575,8 +575,11 @@ impl Vim {
editor.set_input_enabled(!state.vim_controlled());
editor.set_autoindent(state.should_autoindent());
editor.selections.line_mode = matches!(state.mode, Mode::VisualLine);
let context_layer = state.keymap_context_layer();
editor.set_keymap_context_layer::<Self>(context_layer, cx);
if editor.is_focused(cx) {
editor.set_keymap_context_layer::<Self>(state.keymap_context_layer(), cx);
} else {
editor.remove_keymap_context_layer::<Self>(cx);
}
});
}