pub struct UndoVec { /* private fields */ }Expand description
Standard implementation for undo.
Implementations§
Source§impl UndoVec
impl UndoVec
Sourcepub fn enable_undo_styles(&mut self, undo_styles: bool)
pub fn enable_undo_styles(&mut self, undo_styles: bool)
Enable undo for style changes.
Usually not what you want. Unless you allow your users to set styles manually. If your styling is done by a parser, don’t activate this.
Changes to the range of styles and removal of styles caused by text edits will be undone anyway.
Recording those operations for replay will not be affected by this setting.
Sourcepub fn undo_styles(&self) -> bool
pub fn undo_styles(&self) -> bool
Undo for styles are enabled.
Trait Implementations§
Source§impl UndoBuffer for UndoVec
impl UndoBuffer for UndoVec
Source§fn enable_replay_log(&mut self, replay: bool)
fn enable_replay_log(&mut self, replay: bool)
Enable replay functionality.
This keeps track of all changes to a textarea. These changes can be copied to another textarea with the replay() function.
Source§fn recent_replay_log(&mut self) -> Vec<UndoEntry>
fn recent_replay_log(&mut self) -> Vec<UndoEntry>
Get all new replay entries.
Source§fn undo_count(&self) -> u32
fn undo_count(&self) -> u32
How many undoes are stored?
Source§fn set_undo_count(&mut self, n: u32)
fn set_undo_count(&mut self, n: u32)
How many undoes are stored?
Source§fn append(&mut self, undo: UndoOp)
fn append(&mut self, undo: UndoOp)
Appends a new operation at the current undo-position. Read more
Source§fn append_from_replay(&mut self, undo: UndoEntry)
fn append_from_replay(&mut self, undo: UndoEntry)
Appends a new operation but doesn’t fill the replay-log. Read more
Source§fn has_replay_log(&self) -> bool
fn has_replay_log(&self) -> bool
Is the replay-log active?
Source§fn undo_styles_enabled(&self) -> bool
fn undo_styles_enabled(&self) -> bool
Is there undo for setting/removing styles.
Auto Trait Implementations§
impl Freeze for UndoVec
impl RefUnwindSafe for UndoVec
impl Send for UndoVec
impl Sync for UndoVec
impl Unpin for UndoVec
impl UnwindSafe for UndoVec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more