aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-28 19:16:42 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-17 16:14:10 +0000
commit1c8bdf34ced8f263d61293f3559b2dd570a1c23c (patch)
tree15c1e41cb6afa64965e7ee1e21267677a541dcba
parentsearch: match_to_end_of_word(): we always extend the selection with at least one character (diff)
search: match_to_end_of_word(): use has_wrapped_around() while extracting text
-rw-r--r--search.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/search.c b/search.c
index c4bc4a62..1c27e751 100644
--- a/search.c
+++ b/search.c
@@ -472,7 +472,9 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
if (++pos.col >= term->cols) {
pos.row = (pos.row + 1) & (term->grid->num_rows - 1);
pos.col = 0;
- row = term->grid->rows[pos.row];
+
+ if (has_wrapped_around(term, pos.row))
+ break;
}
if (!extract_one(term, row, &row->cells[pos.col], pos.col, ctx))
break;