aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-01-27 17:36:28 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-01-29 16:50:42 +0000
commit739e7d76b4b70da91c50a53026a83d382dd73bae (patch)
treec4a4cbfa1e7219a20dfc720471706eec96a6fd3d /terminal.h
parentsearch: refactor: add add_wchars(), make search_add_chars() use it (diff)
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.
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/terminal.h b/terminal.h
index e6c82f41..1ff4b3b6 100644
--- a/terminal.h
+++ b/terminal.h
@@ -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;