only remove primary index when search next without extend (#948)

pull/961/head
CossonLeo 3 years ago committed by GitHub
parent 44ff597841
commit 1720b98760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save