Skip to main content

UNDO_DEPTH

Constant UNDO_DEPTH 

Source
const UNDO_DEPTH: usize = 50;
Expand description

How many model states the undo (and redo) stack keeps; older entries are evicted.

ponytail: history is a bounded stack of FULL Model clones — one clone per mutation, up to 50 resident copies. That is honest and obviously correct (the model already round-trips and compares by value), but the ceiling is memory: 50 × model size. If models get big enough for that to hurt, replace the snapshots with a command/delta log (per-edit inverse operations) behind the same undo/redo/record_history API — the call sites do not care which it is.