pub struct History { /* private fields */ }Implementations§
Source§impl History
impl History
Sourcepub fn record(&mut self, kind: EditKind, before: Rope, selections: &Selections)
pub fn record(&mut self, kind: EditKind, before: Rope, selections: &Selections)
Record the state before an edit, unless it continues the open run.
Continuing a run means not pushing: the snapshot already on the stack predates the whole run, which is exactly the state undo should restore.
Sourcepub fn depth(&self) -> usize
pub fn depth(&self) -> usize
How many steps are on the undo stack. For tests and for a future status segment; nothing in the editor branches on it.
Sourcepub fn boundary(&mut self)
pub fn boundary(&mut self)
End the open run, so the next edit starts a new undo step.
Called on anything that is not an edit — a motion, a click, a save.
Sourcepub fn undo(
&mut self,
current: Rope,
selections: &Selections,
) -> Option<Snapshot>
pub fn undo( &mut self, current: Rope, selections: &Selections, ) -> Option<Snapshot>
Returns the state to restore, banking current for redo.
pub fn redo( &mut self, current: Rope, selections: &Selections, ) -> Option<Snapshot>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for History
impl RefUnwindSafe for History
impl Send for History
impl Sync for History
impl Unpin for History
impl UnsafeUnpin for History
impl UnwindSafe for History
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more