Filter out vim commands when vim mode is disabled
This commit is contained in:
parent
7e2a461486
commit
b3baebde22
1 changed files with 6 additions and 1 deletions
|
@ -84,7 +84,12 @@ pub fn init(cx: &mut AppContext) {
|
||||||
Vim::active_editor_input_ignored("\n".into(), cx)
|
Vim::active_editor_input_ignored("\n".into(), cx)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Any time settings change, update vim mode to match.
|
// Any time settings change, update vim mode to match. The Vim struct
|
||||||
|
// will be initialized as disabled by default, so we filter its commands
|
||||||
|
// out when starting up.
|
||||||
|
cx.update_default_global::<CommandPaletteFilter, _, _>(|filter, _| {
|
||||||
|
filter.filtered_namespaces.insert("vim");
|
||||||
|
});
|
||||||
cx.update_default_global(|vim: &mut Vim, cx: &mut AppContext| {
|
cx.update_default_global(|vim: &mut Vim, cx: &mut AppContext| {
|
||||||
vim.set_enabled(cx.global::<Settings>().vim_mode, cx)
|
vim.set_enabled(cx.global::<Settings>().vim_mode, cx)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue