mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 21:47:07 +04:00
only remove primary index when search next without extend (#948)
This commit is contained in:
parent
44ff597841
commit
1720b98760
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user