Enum reedline::UndoBehavior
source · [−]pub enum UndoBehavior {
InsertCharacter(char),
Backspace(Option<char>),
Delete(Option<char>),
MoveCursor,
HistoryNavigation,
CreateUndoPoint,
UndoRedo,
}
Expand description
Every line change should come with an UndoBehavior tag, which can be used to calculate how the change should be reflected on the undo stack
Variants
InsertCharacter(char)
Character insertion, tracking the character inserted
Backspace(Option<char>)
Backspace command, tracking the deleted character (left of cursor) Warning: this does not track the whole grapheme, just the character
Delete(Option<char>)
Delete command, tracking the deleted character (right of cursor) Warning: this does not track the whole grapheme, just the character
MoveCursor
Move the cursor position
HistoryNavigation
Navigated the history using up or down arrows
CreateUndoPoint
Catch-all for actions that should always form a unique undo point and never be grouped with later edits
UndoRedo
Undo/Redo actions shouldn’t be reflected on the edit stack
Implementations
sourceimpl UndoBehavior
impl UndoBehavior
sourcepub fn create_undo_point_after(&self, previous: &UndoBehavior) -> bool
pub fn create_undo_point_after(&self, previous: &UndoBehavior) -> bool
Return if the current operation should start a new undo set, or be combined with the previous operation
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for UndoBehavior
impl Send for UndoBehavior
impl Sync for UndoBehavior
impl Unpin for UndoBehavior
impl UnwindSafe for UndoBehavior
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more