Expand description
Tree-based edit history with undo, redo, branching, and checkpointing.
This crate provides EditHistory, a text-editing history that records
edits as nodes in a neco_tree::CursoredTree. When the user undoes
and then makes a new edit, a new branch is created instead of discarding
the old timeline.
Two recording modes are supported:
EntryKind::Reversible: stores forward and inverseTextPatches. Inverse patches are derived automatically from the current text and the forward patches.EntryKind::Snapshot: stores a complete text snapshot. Use this for operations where computing a delta is impractical (e.g. external file reload).
Periodic checkpoints (full snapshots) are inserted automatically so that
jump_to can reach distant nodes efficiently.
Structs§
- Edit
History - Tree-structured edit history with cursor-based undo/redo.
- History
Entry - Data stored in each history node.
- Redo
Result - Information returned by
EditHistory::redo. - Undo
Result - Information returned by
EditHistory::undo.
Enums§
- Entry
Kind - Determines how an edit can be undone/redone.
- Jump
Step - A single step in a
EditHistory::jump_topath.