diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-04-18 12:47:17 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-04-18 12:47:17 +0000 |
| commit | 7b1994fce62fd18744eeb935611b6a08fae2f538 (patch) | |
| tree | d1fe0f6260d5e667c5f866d94f7495d4b86df23c | |
| parent | search: find_next(): assert start/end coords are valid (diff) | |
search: match iterator: wrap iterator’s row number, when needed
| -rw-r--r-- | search.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) { |
