XenoAtom.Terminal.UI provides a lightweight undo/redo system for text editors built on TextEditorBase / TextEditorCore.
Undo/redo is available in:
TextBoxTextAreaMaskedInputNumberBox<T>TextEditorBaseCtrl+ZCtrl+RNote: some terminals remap or intercept certain key combinations. If a key binding does not reach the app, remap it in your terminal.
Replace is undoable.Replace All is recorded as a single undo step.Typing is coalesced into larger undo steps when possible (so you can undo a “typing run” instead of one character at a time). Coalescing is reset by operations like paste, selection replacement, and some cursor/selection changes.
TextEditorBase exposes:
EnableUndo (default: true)MaxUndoEntries (default: 200)CanUndo / CanRedo (bindable state)Undo() / Redo()ClearUndoHistory()Example:
new TextArea("Hello\nWorld")
.EnableUndo(true)
.MaxUndoEntries(500);
Undo history is cleared when:
EnableUndo is set to falseITextDocument methods directly)If you perform external document updates and still want undo/redo, route changes through the editor control (or provide a higher-level edit API that records undo entries).