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

imgbot
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 { let selection = if extend {
selection.clone().push(Range::new(start, end)) selection.clone().push(Range::new(start, end))
} else { } else {
Selection::single(start, end) selection
.clone()
.remove(selection.primary_index())
.push(Range::new(start, end))
}; };
doc.set_selection(view.id, selection); doc.set_selection(view.id, selection);

Loading…
Cancel
Save