diff --git a/crates/vim/src/normal/search.rs b/crates/vim/src/normal/search.rs index 4fbeec7236..f2e1f502dc 100644 --- a/crates/vim/src/normal/search.rs +++ b/crates/vim/src/normal/search.rs @@ -192,6 +192,7 @@ impl Vim { self.search = SearchState { direction, count, + vim_mode_search: true, prior_selections, prior_operator: self.operator_stack.last().cloned(), prior_mode, diff --git a/crates/vim/src/state.rs b/crates/vim/src/state.rs index fe4bc7433d..fd1a5e0cfa 100644 --- a/crates/vim/src/state.rs +++ b/crates/vim/src/state.rs @@ -975,6 +975,7 @@ impl Clone for ReplayableAction { pub struct SearchState { pub direction: Direction, pub count: usize, + pub vim_mode_search: bool, pub prior_selections: Vec>, pub prior_operator: Option, diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs index 9da01e6f44..3c0811f1f1 100644 --- a/crates/vim/src/vim.rs +++ b/crates/vim/src/vim.rs @@ -332,8 +332,12 @@ pub fn init(cx: &mut App) { .and_then(|item| item.act_as::(cx)) .and_then(|editor| editor.read(cx).addon::().cloned()); let Some(vim) = vim else { return }; - vim.entity.update(cx, |_, cx| { - cx.defer_in(window, |vim, window, cx| vim.search_submit(window, cx)) + vim.entity.update(cx, |vim, cx| { + if vim.search.vim_mode_search { + cx.defer_in(window, |vim, window, cx| vim.search_submit(window, cx)) + } else { + cx.propagate() + } }) }); })