aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'search.c')
-rw-r--r--search.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/search.c b/search.c
index a9f5499a..83f86390 100644
--- a/search.c
+++ b/search.c
@@ -18,6 +18,7 @@
#include "selection.h"
#include "shm.h"
#include "util.h"
+#include "xmalloc.h"
/*
* Ensures a "new" viewport doesn't contain any unallocated rows.
@@ -124,6 +125,11 @@ search_begin(struct terminal *term)
term->search.view_followed_offset = term->grid->view == term->grid->offset;
term->is_searching = true;
+ term->search.len = 0;
+ term->search.sz = 64;
+ term->search.buf = xmalloc(term->search.sz * sizeof(term->search.buf[0]));
+ term->search.buf[0] = L'\0';
+
term_xcursor_update(term);
render_refresh_search(term);
}