pub struct HistoryStack { /* private fields */ }Expand description
Manages undo and redo history with automatic typing burst coalescing.
Implementations§
Source§impl HistoryStack
impl HistoryStack
pub fn new(max_depth: usize) -> Self
pub fn can_undo(&self) -> bool
pub fn can_redo(&self) -> bool
Sourcepub fn record_insert(
&mut self,
pos: Position,
text: &str,
before_cursors: Vec<Selection>,
after_cursors: Vec<Selection>,
)
pub fn record_insert( &mut self, pos: Position, text: &str, before_cursors: Vec<Selection>, after_cursors: Vec<Selection>, )
Records an insertion with automatic coalescing if typed within 400ms at adjacent position.
Sourcepub fn record_delete(
&mut self,
start: Position,
end: Position,
text: &str,
before_cursors: Vec<Selection>,
after_cursors: Vec<Selection>,
)
pub fn record_delete( &mut self, start: Position, end: Position, text: &str, before_cursors: Vec<Selection>, after_cursors: Vec<Selection>, )
Records a deletion operation.
Sourcepub fn push_transaction(&mut self, tx: EditorTransaction)
pub fn push_transaction(&mut self, tx: EditorTransaction)
Pushes a transaction onto the undo stack, respecting max depth limit.
Trait Implementations§
Source§impl Clone for HistoryStack
impl Clone for HistoryStack
Source§impl Debug for HistoryStack
impl Debug for HistoryStack
Auto Trait Implementations§
impl Forget for HistoryStack
impl Freeze for HistoryStack
impl Move for HistoryStack
impl RefUnwindSafe for HistoryStack
impl Send for HistoryStack
impl Sync for HistoryStack
impl Unpin for HistoryStack
impl UnsafeUnpin for HistoryStack
impl UnwindSafe for HistoryStack
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