Add swap file journaling for crash recovery.

- Introduced `SwapManager` for buffering and writing incremental edits to sidecar `.kte.swp` files.
- Implemented basic operations: insertion, deletion, split, join, and checkpointing.
- Added recovery design doc (`docs/plans/swap-files.md`).
- Updated editor initialization to integrate `SwapManager` instance for crash recovery across buffers.
This commit is contained in:
2025-12-04 08:48:32 -08:00
parent 495183ebd2
commit 78b9345799
24 changed files with 1933 additions and 545 deletions

View File

@@ -90,6 +90,7 @@ enum class CommandId {
ShowHelp, // open +HELP+ buffer with manual text (C-k h)
// Meta
UnknownKCommand, // arg: single character that was not recognized after C-k
UnknownEscCommand, // invalid ESC (meta) command; show status and exit escape mode
// Generic command prompt
CommandPromptStart, // begin generic command prompt (C-k ;)
// Theme by name
@@ -128,6 +129,9 @@ struct Command {
CommandHandler handler;
// Public commands are exposed in the ": " prompt (C-k ;)
bool isPublic = false;
// Whether this command should consume and honor a universal argument repeat count.
// Default true per issue request; authors can turn off per-command.
bool repeatable = true;
};