mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
search: match_to_end_of_word: bug: reset end-col when bumping end-row
When we calculate the end coords, we must reset end-col when we reach the end of the line and bump the end-row. This fixes an issue where bumping the row once lead to the end row being bumped for *each* remaining match character.
This commit is contained in:
parent
6cfb3216c3
commit
0f98101bbc
1 changed files with 3 additions and 1 deletions
4
search.c
4
search.c
|
|
@ -281,8 +281,10 @@ search_match_to_end_of_word(struct terminal *term, bool spaces_only)
|
|||
|
||||
/* Calculate end coord - note: assumed to be valid */
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (++end_col >= term->cols)
|
||||
if (++end_col >= term->cols) {
|
||||
end_row = (end_row + 1) % term->grid->num_rows;
|
||||
end_col = 0;
|
||||
}
|
||||
}
|
||||
|
||||
tll(wchar_t) new_chars = tll_init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue