search: match_to_end_of_word(): we update the selection ourselves

No need to call search_find_next() after doing a
search_match_to_end_of_word(), since we already *know* we have a
match, and where it is.
This commit is contained in:
Daniel Eklöf 2021-03-30 14:40:59 +02:00
parent a6d9f01c0d
commit 96b19212d3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -508,10 +508,14 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
if (move_cursor)
term->search.cursor = term->search.len;
/* search_update_selection() expected end coordinate to be *exclusive* */
newline(new_end);
search_update_selection(
term, term->search.match.row, term->search.match.col,
new_end.row, new_end.col);
term->search.match_len = term->search.len;
#undef newline
}
@ -755,12 +759,14 @@ execute_binding(struct seat *seat, struct terminal *term,
case BIND_ACTION_SEARCH_EXTEND_WORD:
search_match_to_end_of_word(term, false);
*update_search_result = *redraw = true;
*update_search_result = false;
*redraw = true;
return true;
case BIND_ACTION_SEARCH_EXTEND_WORD_WS:
search_match_to_end_of_word(term, true);
*update_search_result = *redraw = true;
*update_search_result = false;
*redraw = true;
return true;
case BIND_ACTION_SEARCH_CLIPBOARD_PASTE: