mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
search: match iterator: wrap iterator’s row number, when needed
This commit is contained in:
parent
a9ed719f90
commit
7b1994fce6
1 changed files with 6 additions and 0 deletions
6
search.c
6
search.c
|
|
@ -530,6 +530,12 @@ search_matches_next(struct search_match_iterator *iter)
|
|||
iter->start.row = match.start.row;
|
||||
iter->start.col = match.start.col + 1;
|
||||
|
||||
if (iter->start.col >= term->cols) {
|
||||
iter->start.col = 0;
|
||||
iter->start.row++;
|
||||
iter->start.row &= grid->num_rows - 1;
|
||||
}
|
||||
|
||||
if (match.start.row == term->search.match.row &&
|
||||
match.start.col == term->search.match.col)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue