This commit is contained in:
Vivek Jain 2025-08-25 21:33:31 -06:00 committed by GitHub
commit d0c0f60043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -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,

View file

@ -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<Range<Anchor>>,
pub prior_operator: Option<Operator>,

View file

@ -332,8 +332,12 @@ pub fn init(cx: &mut App) {
.and_then(|item| item.act_as::<Editor>(cx))
.and_then(|editor| editor.read(cx).addon::<VimAddon>().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()
}
})
});
})