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

@ -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;
}