pub enum Axis {
Horizontal,
Vertical,
}Expand description
This represents a selection of a 2-dimensional axis.
Variants§
Horizontal
The horizontal axis.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let axis = Axis::Horizontal;
let scroll: Action = Action::Scroll(ScrollStyle::CursorPos(MovePosition::End, axis));
// All of these are equivalent:
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x horizontal)"));
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x h)"));
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x {axis})"));Vertical
The vertical axis.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action};
let axis = Axis::Vertical;
let scroll: Action = Action::Scroll(ScrollStyle::CursorPos(MovePosition::End, axis));
// All of these are equivalent:
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x vertical)"));
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x v)"));
assert_eq!(scroll, action!("scroll -s (cursor-pos -p end -x {axis})"));Implementations§
Trait Implementations§
impl Copy for Axis
impl Eq for Axis
impl StructuralPartialEq for Axis
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnwindSafe for Axis
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