pub enum TargetShape {
CharWise,
LineWise,
BlockWise,
}Expand description
This specifies either the shape of a visual selection, or a forced motion.
Variants§
CharWise
A series of characters.
During a selection, the two points indicate the start and end columns.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let shape = TargetShape::CharWise;
let count = Count::Contextual;
let act: Action = InsertTextAction::OpenLine(shape, MoveDir1D::Next, count).into();
// All of these are equivalent:
assert_eq!(act, action!("insert open-line -S charwise -d next"));
assert_eq!(act, action!("insert open-line -S char -d next"));LineWise
A series of lines.
During a selection, the two points indicate the start and end lines.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let shape = TargetShape::LineWise;
let count = Count::Contextual;
let act: Action = InsertTextAction::OpenLine(shape, MoveDir1D::Next, count).into();
// All of these are equivalent:
assert_eq!(act, action!("insert open-line -S linewise -d next"));
assert_eq!(act, action!("insert open-line -S line -d next"));BlockWise
A block of characters.
During a selection, the two points indicate opposite corners.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let shape = TargetShape::BlockWise;
let count = Count::Contextual;
let act: Action = InsertTextAction::OpenLine(shape, MoveDir1D::Next, count).into();
// All of these are equivalent:
assert_eq!(act, action!("insert open-line -S blockwise -d next"));
assert_eq!(act, action!("insert open-line -S block -d next"));Trait Implementations§
Source§impl Clone for TargetShape
impl Clone for TargetShape
Source§fn clone(&self) -> TargetShape
fn clone(&self) -> TargetShape
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 TargetShape
impl Debug for TargetShape
Source§impl From<TargetShape> for TargetShapeFilter
impl From<TargetShape> for TargetShapeFilter
Source§fn from(shape: TargetShape) -> Self
fn from(shape: TargetShape) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TargetShape
impl PartialEq for TargetShape
impl Copy for TargetShape
impl Eq for TargetShape
impl StructuralPartialEq for TargetShape
Auto Trait Implementations§
impl Freeze for TargetShape
impl RefUnwindSafe for TargetShape
impl Send for TargetShape
impl Sync for TargetShape
impl Unpin for TargetShape
impl UnwindSafe for TargetShape
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