pub struct UndoEntry {
pub rope: Rope,
pub cursor: (usize, usize),
pub timestamp: SystemTime,
pub marks: MarkSnapshot,
}Expand description
A single entry in the undo or redo stack.
The timestamp records the wall-clock time at which the snapshot was
taken (i.e. when push_undo was called), enabling the :earlier /
:later time-travel ex commands to walk the stack by duration rather
than by step count.
Stored as a ropey::Rope (O(1) Arc-clone) rather than a String so
snapshot cost is negligible even on multi-MB buffers.
Fields§
§rope: Rope§cursor: (usize, usize)§timestamp: SystemTime§marks: MarkSnapshotLocal marks / jumplist / changelist / this-buffer’s-global-marks
snapshot, so undo/redo restore mark-ish positions alongside the
text instead of leaving them shifted by the edit being undone
(audit-r2 fix 2). Default::default() (all empty) for callers
that don’t populate it — restoring an all-empty snapshot is a
no-op against a freshly-constructed buffer’s own empty state, so
existing fixtures that only care about text/cursor stay valid.