aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-30 12:40:59 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-17 16:14:10 +0000
commit96b19212d34ffb713927d28669ad0b2f011f4598 (patch)
treea7e727666533f94203b25c2797215e73d1446d91
parentextract: move ‘strip_trailing_empty’ parameter from extra_finish() to extract_begin() (diff)
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.
-rw-r--r--search.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/search.c b/search.c
index e7d03fe1..3d1ace4b 100644
--- a/search.c
+++ b/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: