pub enum MoveDirMod {
Same,
Flip,
Exact(MoveDir1D),
}Expand description
Represents a modification of a previous MoveDir1D movement.
Variants§
Same
Use the same movement previously used.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, CommandBarAction};
let dir = MoveDirMod::Same;
let search: Action = action!("search -d same");
assert_eq!(search, Action::Search(dir, Count::Contextual));Flip
Use the opposite of the movement previously used.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, CommandBarAction};
let dir = MoveDirMod::Flip;
let search: Action = action!("search -d flip");
assert_eq!(search, Action::Search(dir, Count::Contextual));Exact(MoveDir1D)
Ignore whatever value was previously used.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, CommandBarAction};
let dir = MoveDirMod::Exact(MoveDir1D::Previous);
let search: Action = action!("search -d (exact prev)");
assert_eq!(search, Action::Search(dir, Count::Contextual));
let dir = MoveDirMod::Exact(MoveDir1D::Next);
let search: Action = action!("search -d (exact next)");
assert_eq!(search, Action::Search(dir, Count::Contextual));Implementations§
Trait Implementations§
Source§impl Clone for MoveDirMod
impl Clone for MoveDirMod
Source§fn clone(&self) -> MoveDirMod
fn clone(&self) -> MoveDirMod
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 MoveDirMod
impl Debug for MoveDirMod
Source§impl From<MoveDir1D> for MoveDirMod
impl From<MoveDir1D> for MoveDirMod
Source§impl PartialEq for MoveDirMod
impl PartialEq for MoveDirMod
impl Copy for MoveDirMod
impl Eq for MoveDirMod
impl StructuralPartialEq for MoveDirMod
Auto Trait Implementations§
impl Freeze for MoveDirMod
impl RefUnwindSafe for MoveDirMod
impl Send for MoveDirMod
impl Sync for MoveDirMod
impl Unpin for MoveDirMod
impl UnwindSafe for MoveDirMod
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