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

@ -34,6 +34,9 @@ export type EditorAction =
| "selectCancel"
// Clipboard
| "copy"
// Kill ring
| "yank"
| "yankPop"
// Tool output
| "expandTools";
@ -81,6 +84,9 @@ export const DEFAULT_EDITOR_KEYBINDINGS: Required<EditorKeybindingsConfig> = {
selectCancel: ["escape", "ctrl+c"],
// Clipboard
copy: "ctrl+c",
// Kill ring
yank: "ctrl+y",
yankPop: "alt+y",
// Tool output
expandTools: "ctrl+o",
};