aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-term/src/commands.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 28657865..cc9106eb 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1161,7 +1161,10 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
let selection = if extend {
selection.clone().push(Range::new(start, end))
} else {
- Selection::single(start, end)
+ selection
+ .clone()
+ .remove(selection.primary_index())
+ .push(Range::new(start, end))
};
doc.set_selection(view.id, selection);