From 1c8bdf34ced8f263d61293f3559b2dd570a1c23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 28 Mar 2021 21:16:42 +0200 Subject: [PATCH] search: match_to_end_of_word(): use has_wrapped_around() while extracting text --- search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;