pub enum HistoryAction {
Checkpoint,
Redo(Count),
Undo(Count),
}Expand description
Actions for manipulating a buffer’s history.
Variants§
Checkpoint
Create a new editing history checkpoint.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, HistoryAction};
let check: Action = action!("history checkpoint");
assert_eq!(check, HistoryAction::Checkpoint.into());Redo(Count)
Redo n edits.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, HistoryAction};
let redo: Action = action!("history redo");
assert_eq!(redo, HistoryAction::Redo(Count::Contextual).into());
let redo: Action = action!("history redo -c 1");
assert_eq!(redo, HistoryAction::Redo(Count::Exact(1)).into());Undo(Count)
Undo n edits.
use editor_types::prelude::*;
use editor_types::{action, Action, HistoryAction};
let undo: Action = action!("history undo");
assert_eq!(undo, HistoryAction::Undo(Count::Contextual).into());
let undo: Action = action!("history undo -c 1");
assert_eq!(undo, HistoryAction::Undo(Count::Exact(1)).into());Implementations§
Source§impl HistoryAction
impl HistoryAction
Sourcepub fn is_readonly(&self) -> bool
pub fn is_readonly(&self) -> bool
Returns true if this HistoryAction doesn’t modify a buffer’s text.
Trait Implementations§
Source§impl Clone for HistoryAction
impl Clone for HistoryAction
Source§fn clone(&self) -> HistoryAction
fn clone(&self) -> HistoryAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HistoryAction
impl Debug for HistoryAction
Source§impl<I: ApplicationInfo> From<HistoryAction> for Action<I>
impl<I: ApplicationInfo> From<HistoryAction> for Action<I>
Source§fn from(act: HistoryAction) -> Self
fn from(act: HistoryAction) -> Self
Converts to this type from the input type.
Source§impl From<HistoryAction> for EditorAction
impl From<HistoryAction> for EditorAction
Source§fn from(act: HistoryAction) -> Self
fn from(act: HistoryAction) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HistoryAction
impl PartialEq for HistoryAction
impl Eq for HistoryAction
impl StructuralPartialEq for HistoryAction
Auto Trait Implementations§
impl Freeze for HistoryAction
impl RefUnwindSafe for HistoryAction
impl Send for HistoryAction
impl Sync for HistoryAction
impl Unpin for HistoryAction
impl UnwindSafe for HistoryAction
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