mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-16 22:05:21 -05:00
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:
parent
a6d9f01c0d
commit
96b19212d3
1 changed files with 8 additions and 2 deletions
10
search.c
10
search.c
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue