aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-05 10:49:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-07 19:44:12 +0000
commitf51ce347532d0c0c0169ba6e1d32a09b13481ed4 (patch)
tree72441de7a30d34a70f0a888b54eecbc2a7255709 /search.c
parentime: don’t commit to the slave while scrollback searching (diff)
search: new function: search_add_chars()
This function inserts a string into the search buffer, at the current insertion point (i.e. where the cursor is).
Diffstat (limited to 'search.c')
-rw-r--r--search.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/search.c b/search.c
index bd5effce..a9f5499a 100644
--- a/search.c
+++ b/search.c
@@ -332,8 +332,8 @@ search_find_next(struct terminal *term)
#undef ROW_DEC
}
-static void
-add_chars(struct terminal *term, const char *src, size_t count)
+void
+search_add_chars(struct terminal *term, const char *src, size_t count)
{
mbstate_t ps = {0};
size_t wchars = mbsnrtowcs(NULL, &src, count, 0, &ps);
@@ -494,7 +494,7 @@ static void
from_clipboard_cb(char *text, size_t size, void *user)
{
struct terminal *term = user;
- add_chars(term, text, size);
+ search_add_chars(term, text, size);
}
static void
@@ -722,7 +722,7 @@ search_input(struct seat *seat, struct terminal *term, uint32_t key,
if (count == 0)
return;
- add_chars(term, (const char *)buf, count);
+ search_add_chars(term, (const char *)buf, count);
update_search:
LOG_DBG("search: buffer: %ls", term->search.buf);