aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-30 12:29:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-17 16:14:10 +0000
commit0945e71572c853dfdeedc90b512668ab946a5468 (patch)
treea08b3e0ad2b63822fad3e3a8de7bdf04327e2878 /search.c
parentsearch: match_to_end_of_word(): use a local macro to bump coord (diff)
search: find_next(): correctly wrap row number
Diffstat (limited to 'search.c')
-rw-r--r--search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/search.c b/search.c
index 86cea232..cce205d4 100644
--- a/search.c
+++ b/search.c
@@ -338,7 +338,7 @@ search_find_next(struct terminal *term)
for (size_t i = 0; i < term->search.len;) {
if (end_col >= term->cols) {
- end_row++;
+ end_row = (end_row + 1) & (term->grid->num_rows - 1);
end_col = 0;
if (has_wrapped_around(term, end_row))