diff --git a/crates/ui/src/history.rs b/crates/ui/src/history.rs index 6a854b72..05eb9d23 100644 --- a/crates/ui/src/history.rs +++ b/crates/ui/src/history.rs @@ -80,6 +80,22 @@ where self.undos.push(item); } + /// Get the undo stack. + pub fn undos(&self) -> &Vec { + &self.undos + } + + /// Get the redo stack. + pub fn redos(&self) -> &Vec { + &self.redos + } + + /// Clear the undo and redo stacks. + pub fn clear(&mut self) { + self.undos.clear(); + self.redos.clear(); + } + pub fn undo(&mut self) -> Option> { if let Some(first_change) = self.undos.pop() { let mut changes = vec![first_change.clone()];