Don't show vim mode when disabled (#2863)

Fixes vim's mode indicator showing up when vim is disabled.
This commit is contained in:
Conrad Irwin 2023-08-18 16:00:46 -06:00 committed by GitHub
commit f0ebbd01e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,9 +22,11 @@ fn focused(EditorFocused(editor): &EditorFocused, cx: &mut AppContext) {
editor.window().update(cx, |cx| {
Vim::update(cx, |vim, cx| {
vim.set_active_editor(editor.clone(), cx);
cx.emit_global(VimEvent::ModeChanged {
mode: vim.state().mode,
});
if vim.enabled {
cx.emit_global(VimEvent::ModeChanged {
mode: vim.state().mode,
});
}
});
});
}