mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
search: for now, reset search match state whenever the buffer changes
This commit is contained in:
parent
4c9e7d0c19
commit
9c6ece747e
1 changed files with 9 additions and 0 deletions
9
search.c
9
search.c
|
|
@ -293,6 +293,9 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
|
|||
(term->search.len - term->search.cursor) * sizeof(wchar_t));
|
||||
term->search.cursor--;
|
||||
term->search.buf[--term->search.len] = L'\0';
|
||||
|
||||
term->search.match = (struct coord){-1, -1};
|
||||
term->search.match_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -312,6 +315,9 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
|
|||
&term->search.buf[term->search.cursor + 1],
|
||||
(term->search.len - term->search.cursor - 1) * sizeof(wchar_t));
|
||||
term->search.buf[--term->search.len] = L'\0';
|
||||
|
||||
term->search.match = (struct coord){-1, -1};
|
||||
term->search.match_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -363,6 +369,9 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
|
|||
term->search.len += wchars;
|
||||
term->search.cursor += wchars;
|
||||
term->search.buf[term->search.len] = L'\0';
|
||||
|
||||
term->search.match = (struct coord){-1, -1};
|
||||
term->search.match_len = 0;
|
||||
}
|
||||
|
||||
LOG_DBG("search: buffer: %S", term->search.buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue