aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))