@@ -1161,7 +1161,10 @@ fn search_impl(doc: &mut Document, view: &mut View, contents: &str, regex: &Rege
11611161 let selection = if extend {
11621162 selection.clone().push(Range::new(start, end))
11631163 } else {
1164− Selection::single(start, end)
1164+ selection
1165+ .clone()
1166+ .remove(selection.primary_index())
1167+ .push(Range::new(start, end))
11651168 };
11661169
11671170 doc.set_selection(view.id, selection);