fix: replace unnecessary memmove, add more documentation for new keybinding.

Ref: #1972, #1983
This commit is contained in:
Adrian fxj9a 2025-03-05 08:35:43 +01:00
parent ff058c5611
commit 86037f7d83
No known key found for this signature in database
GPG key ID: FA1E6994A87D434E
2 changed files with 7 additions and 5 deletions

View file

@ -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 Deletes the **word after** the cursor. Default: _Mod1+d
Control+Delete_. 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-char*
Extend current selection to the right, by one character. Default: Extend current selection to the right, by one character. Default:
_Shift+Right_. _Shift+Right_.

View file

@ -1281,11 +1281,7 @@ execute_binding(struct seat *seat, struct terminal *term,
case BIND_ACTION_SEARCH_DELETE_TO_END: { case BIND_ACTION_SEARCH_DELETE_TO_END: {
if (term->search.cursor < term->search.len) { if (term->search.cursor < term->search.len) {
memmove(&term->search.buf[term->search.cursor], term->search.buf[term->search.cursor] = '\0';
&term->search.buf[term->search.len],
(term->search.len + term->search.cursor - term->search.len)
* sizeof(char32_t));
term->search.len = term->search.cursor; term->search.len = term->search.cursor;
*update_search_result = *redraw = true; *update_search_result = *redraw = true;
} }