search: remember last searched-for string between searches

Regardless of how we exit search mode (commit or cancel), the search
string is remembered.

The next time we enter search mode, the last searched-for string will
be used when searching for the next/prev match (ctrl+r, ctrl+s), and
the search query is empty.
This commit is contained in:
Daniel Eklöf 2022-01-27 18:36:28 +01:00
parent 22266e384b
commit 739e7d76b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 33 additions and 5 deletions

View file

@ -514,6 +514,11 @@ struct terminal {
bool view_followed_offset;
struct coord match;
size_t match_len;
struct {
wchar_t *buf;
size_t len;
} last;
} search;
struct wayland *wl;