fix: move word search activation onto its match

This commit is contained in:
Valdemar Lorenzen
2026-10-15 12:38:50 +02:00
parent f5c6d098f8
commit 3a7e2074b4
3 changed files with 38 additions and 11 deletions
+6 -7
View File
@@ -8482,20 +8482,19 @@ impl Editor {
))
}
fn seek_search(&mut self, action: Action, count: usize) {
fn seek_search(&mut self, mut action: Action, mut count: usize) {
self.reveal_caret();
let primary_origin = if action == Action::SearchWord {
let Some((origin, newly_active)) = self.set_word_search() else {
return;
};
if newly_active {
self.active.view.search_match = Some(SearchMatch {
start: origin,
end_column: origin.column + grapheme_count(&self.active.view.search_query),
});
return;
action = Action::Search;
count = 1;
None
} else {
Some(origin)
}
Some(origin)
} else {
None
};