Add Ctrl-k to delete to end of line and Ctrl-u to delete to start of line.

This commit is contained in:
T. Kurt Bond 2025-05-15 15:17:56 -04:00
commit e0eafa0b14
2 changed files with 13 additions and 0 deletions

11
h-m-m
View file

@ -1875,6 +1875,17 @@ function magic_readline(&$mm, $title)
elseif ($in==special_keys['enter'])
return trim($title);
elseif ($in==special_keys['ctrl_k'])
{
$title = mb_substr ($title, 0, $cursor-1);
}
elseif ($in==special_keys['ctrl_u'])
{
$title = mb_substr ($title, $cursor-1);
$cursor = 1;
}
elseif ($in==special_keys['ctrl_v'])
{
$content =

View file

@ -104,6 +104,8 @@ In the text editor:
* `Ctrl+Delete`or `Alt-d` - deletes word
* `Backspace` - deletes previous character
* `ctrl+Backspace`, `ctrl+w` - deletes previous word
* `Ctrl-k` - deletes everything to the right of the cursor
* `Ctrl-u` - deletes everything to the left of the cursor
* `Ctrl+v` or `Ctrl+Shift+v` - paste
* `Esc` - cancels editing
* `Enter` - wanna guess? ;)