Revert "Keep selection in SwitchToHelixNormalMode (#41583)" (#42892)

Closes #ISSUE

Release Notes:

- Fixes vim "go to definition" making a selection
This commit is contained in:
Conrad Irwin
2025-11-17 11:01:34 -07:00
committed by GitHub
parent 46ad6c0bbb
commit 6bf5e92a25
18 changed files with 94 additions and 183 deletions
+6 -2
View File
@@ -847,6 +847,9 @@ impl Vim {
let mut start_selection = 0usize;
let mut end_selection = 0usize;
self.update_editor(cx, |_, editor, _| {
editor.set_collapse_matches(false);
});
if vim_is_normal {
pane.update(cx, |pane, cx| {
if let Some(search_bar) = pane.toolbar().read(cx).item_of_type::<BufferSearchBar>()
@@ -857,7 +860,7 @@ impl Vim {
}
// without update_match_index there is a bug when the cursor is before the first match
search_bar.update_match_index(window, cx);
search_bar.select_match(direction.opposite(), 1, false, window, cx);
search_bar.select_match(direction.opposite(), 1, window, cx);
});
}
});
@@ -875,7 +878,7 @@ impl Vim {
if let Some(search_bar) = pane.toolbar().read(cx).item_of_type::<BufferSearchBar>() {
search_bar.update(cx, |search_bar, cx| {
search_bar.update_match_index(window, cx);
search_bar.select_match(direction, count, false, window, cx);
search_bar.select_match(direction, count, window, cx);
match_exists = search_bar.match_exists(window, cx);
});
}
@@ -902,6 +905,7 @@ impl Vim {
editor.change_selections(Default::default(), window, cx, |s| {
s.select_ranges([start_selection..end_selection]);
});
editor.set_collapse_matches(true);
});
match self.maybe_pop_operator() {