diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 56004654..c55419d1 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -1401,6 +1401,12 @@ scrollback search mode. The syntax is exactly the same as the regular Deletes the **word after** the cursor. Default: _Mod1+d Control+Delete_. +*delete-to-start* + Deletes search input before the cursor. Default: _Ctrl+u_. + +*delete-to-end* + Deletes search input after the cursor. Default: _Ctrl+k_. + *extend-char* Extend current selection to the right, by one character. Default: _Shift+Right_. diff --git a/search.c b/search.c index 19fa0a5e..dda84e6d 100644 --- a/search.c +++ b/search.c @@ -1281,11 +1281,7 @@ execute_binding(struct seat *seat, struct terminal *term, case BIND_ACTION_SEARCH_DELETE_TO_END: { if (term->search.cursor < term->search.len) { - memmove(&term->search.buf[term->search.cursor], - &term->search.buf[term->search.len], - (term->search.len + term->search.cursor - term->search.len) - * sizeof(char32_t)); - + term->search.buf[term->search.cursor] = '\0'; term->search.len = term->search.cursor; *update_search_result = *redraw = true; }