Add a keybinding for ctrl+w to delete the previous word. (#582)

Adds the following new keybindings to the cli text input buffer:

- `Ctrl+W` : Delete previous word
This commit is contained in:
DeWitt Clinton 2025-05-28 09:59:25 -07:00 committed by GitHub
parent 27a773d5b2
commit 98dcf43214
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -1176,6 +1176,7 @@ export function useTextBuffer({
else if (key['ctrl'] && input === 'a') move('home');
else if (key['end']) move('end');
else if (key['ctrl'] && input === 'e') move('end');
else if (key['ctrl'] && input === 'w') deleteWordLeft();
else if (
(key['meta'] || key['ctrl'] || key['alt']) &&
(key['backspace'] || input === '\x7f')