Merge 55f3f6c60f
into 633ce23ae9
This commit is contained in:
commit
d0c0f60043
3 changed files with 8 additions and 2 deletions
|
@ -192,6 +192,7 @@ impl Vim {
|
||||||
self.search = SearchState {
|
self.search = SearchState {
|
||||||
direction,
|
direction,
|
||||||
count,
|
count,
|
||||||
|
vim_mode_search: true,
|
||||||
prior_selections,
|
prior_selections,
|
||||||
prior_operator: self.operator_stack.last().cloned(),
|
prior_operator: self.operator_stack.last().cloned(),
|
||||||
prior_mode,
|
prior_mode,
|
||||||
|
|
|
@ -975,6 +975,7 @@ impl Clone for ReplayableAction {
|
||||||
pub struct SearchState {
|
pub struct SearchState {
|
||||||
pub direction: Direction,
|
pub direction: Direction,
|
||||||
pub count: usize,
|
pub count: usize,
|
||||||
|
pub vim_mode_search: bool,
|
||||||
|
|
||||||
pub prior_selections: Vec<Range<Anchor>>,
|
pub prior_selections: Vec<Range<Anchor>>,
|
||||||
pub prior_operator: Option<Operator>,
|
pub prior_operator: Option<Operator>,
|
||||||
|
|
|
@ -332,8 +332,12 @@ pub fn init(cx: &mut App) {
|
||||||
.and_then(|item| item.act_as::<Editor>(cx))
|
.and_then(|item| item.act_as::<Editor>(cx))
|
||||||
.and_then(|editor| editor.read(cx).addon::<VimAddon>().cloned());
|
.and_then(|editor| editor.read(cx).addon::<VimAddon>().cloned());
|
||||||
let Some(vim) = vim else { return };
|
let Some(vim) = vim else { return };
|
||||||
vim.entity.update(cx, |_, cx| {
|
vim.entity.update(cx, |vim, cx| {
|
||||||
cx.defer_in(window, |vim, window, cx| vim.search_submit(window, cx))
|
if vim.search.vim_mode_search {
|
||||||
|
cx.defer_in(window, |vim, window, cx| vim.search_submit(window, cx))
|
||||||
|
} else {
|
||||||
|
cx.propagate()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue