mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
search: bug: re-initialize start-row when attempting a new match
When we've already found a partial match (but *not* a complete match), and that match spanned multiple lines, then when we continued with the next start-column we re-used a know-wrong row pointer.
This commit is contained in:
parent
3c71389993
commit
008281757b
1 changed files with 4 additions and 4 deletions
8
search.c
8
search.c
|
|
@ -194,14 +194,14 @@ search_find_next(struct terminal *term)
|
||||||
r < term->grid->num_rows;
|
r < term->grid->num_rows;
|
||||||
backward ? ROW_DEC(start_row) : ROW_INC(start_row), r++)
|
backward ? ROW_DEC(start_row) : ROW_INC(start_row), r++)
|
||||||
{
|
{
|
||||||
const struct row *row = term->grid->rows[start_row];
|
|
||||||
if (row == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (;
|
for (;
|
||||||
backward ? start_col >= 0 : start_col < term->cols;
|
backward ? start_col >= 0 : start_col < term->cols;
|
||||||
backward ? start_col-- : start_col++)
|
backward ? start_col-- : start_col++)
|
||||||
{
|
{
|
||||||
|
const struct row *row = term->grid->rows[start_row];
|
||||||
|
if (row == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (wcsncasecmp(&row->cells[start_col].wc, term->search.buf, 1) != 0)
|
if (wcsncasecmp(&row->cells[start_col].wc, term->search.buf, 1) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue