feat(tui): implement Emacs-style kill ring for Editor

Add kill ring functionality with:

- Ctrl+W/U/K save deleted text to kill ring
- Ctrl+Y yanks (pastes) most recent deletion
- Alt+Y cycles through kill ring (after Ctrl+Y)
- Consecutive deletions accumulate into single entry
This commit is contained in:
Sviatoslav Abakumov 2026-01-17 16:28:20 +04:00 committed by Mario Zechner
parent bafddc27ed
commit 9fb7434a06
4 changed files with 577 additions and 2 deletions

View file

@ -3439,6 +3439,8 @@ export class InteractiveMode {
const deleteWordBackward = this.getEditorKeyDisplay("deleteWordBackward");
const deleteToLineStart = this.getEditorKeyDisplay("deleteToLineStart");
const deleteToLineEnd = this.getEditorKeyDisplay("deleteToLineEnd");
const yank = this.getEditorKeyDisplay("yank");
const yankPop = this.getEditorKeyDisplay("yankPop");
const tab = this.getEditorKeyDisplay("tab");
// App keybindings
@ -3471,6 +3473,8 @@ export class InteractiveMode {
| \`${deleteWordBackward}\` | Delete word backwards |
| \`${deleteToLineStart}\` | Delete to start of line |
| \`${deleteToLineEnd}\` | Delete to end of line |
| \`${yank}\` | Paste the most-recently-deleted text |
| \`${yankPop}\` | Cycle through the deleted text after pasting |
**Other**
| Key | Action |