Skip to main content

Module undoer

Module undoer 

Source
Expand description

Time-coalescing undo/redo history — a faithful port of egui’s egui::util::undoer::Undoer<State> (see egui-reference/crates/egui/src/util/undoer.rs).

A single Undoer snapshots a whole state value State with the time-based coalescing egui demonstrates: an undo point is created once the state has been stable for stable_time, or forcibly every auto_save_interval if the user never stops changing it.

Lives in the crate::undo module alongside the command-history UndoBuffer: they are complementary models (snapshot vs. command). The RichTextEdit widget snapshots {RichDoc, caret} through it, and the dialogs demo snapshots its {toggle, text}.

Structs§

Settings
Tuning knobs for Undoer. Mirrors egui’s Settings.
Undoer
Automatic undo system. Feed it the latest state every frame; it decides when to snapshot a new undo point.