Keep selection in SwitchToHelixNormalMode (#41583)
Closes #41125 Release Notes: - Fixed `SwitchToHelixNormalMode` to keep selection - Added default keybinds for `SwitchToHelixNormalMode` when in Helix mode
This commit is contained in:
@@ -847,9 +847,6 @@ 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>()
|
||||
@@ -860,7 +857,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, window, cx);
|
||||
search_bar.select_match(direction.opposite(), 1, false, window, cx);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -878,7 +875,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, window, cx);
|
||||
search_bar.select_match(direction, count, false, window, cx);
|
||||
match_exists = search_bar.match_exists(window, cx);
|
||||
});
|
||||
}
|
||||
@@ -905,7 +902,6 @@ 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() {
|
||||
|
||||
Reference in New Issue
Block a user