mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
search: matches_next: stop searching when start.row >= term->rows
As this means the last call to sarch_matches_next() found a match at the bottom of the view, and then set the iter’s *next* start position to a row outside the view. This is fine, but we need to handle it, by immediately stopping the iter.
This commit is contained in:
parent
d068e821d6
commit
082e242ce5
1 changed files with 10 additions and 1 deletions
11
search.c
11
search.c
|
|
@ -539,7 +539,16 @@ search_matches_next(struct search_match_iterator *iter)
|
|||
/* First, return the primary match */
|
||||
match = term->selection.coords;
|
||||
found = true;
|
||||
} else {
|
||||
}
|
||||
|
||||
else if (iter->start.row >= term->rows) {
|
||||
goto no_match;
|
||||
}
|
||||
|
||||
else {
|
||||
xassert(iter->start.row >= 0);
|
||||
xassert(iter->start.row < term->rows);
|
||||
|
||||
struct coord abs_start = iter->start;
|
||||
abs_start.row = grid_row_absolute_in_view(grid, abs_start.row);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue