search: for now, reset search match state whenever the buffer changes

This commit is contained in:
Daniel Eklöf 2019-08-29 21:10:13 +02:00
parent 4c9e7d0c19
commit 9c6ece747e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);