Enum modalkit::actions::SelectionAction
source · #[non_exhaustive]pub enum SelectionAction {
Duplicate(MoveDir1D, Count),
CursorSet(SelectionCursorChange),
Expand(SelectionBoundary, TargetShapeFilter),
Filter(bool),
Join,
Resize(SelectionResizeStyle, EditTarget),
Split(SelectionSplitStyle, TargetShapeFilter),
Trim(SelectionBoundary, TargetShapeFilter),
}
Expand description
Selection manipulation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Duplicate(MoveDir1D, Count)
Duplicate selections n times to adjacent lines in MoveDir1D direction.
If the column positions are too large to fit on the adjacent lines, then the next line large enough to hold the selection is used instead.
CursorSet(SelectionCursorChange)
Change the placement of the cursor and anchor of a visual selection.
Expand(SelectionBoundary, TargetShapeFilter)
Expand a selection by repositioning its cursor and anchor such that they are placed on the specified boundary.
Be aware that since this repositions the start and end of the selection, this may not do what you want with TargetShape::BlockWise selections.
Filter(bool)
Filter selections using the Register::LastSearch regular expression.
The bool argument indicates whether we should drop selections that match instead of keeping them.
Join
Join adjacent selections together.
Resize(SelectionResizeStyle, EditTarget)
Change the bounds of the current selection as described by the style and target.
If the context doesn’t specify a selection shape, then the selection will determine its shape from the EditTarget.
Split(SelectionSplitStyle, TargetShapeFilter)
Split matching selections into multiple selections line.
All of the new selections are of the same shape as the one they were split from.
Trim(SelectionBoundary, TargetShapeFilter)
Shrink a selection by repositioning its cursor and anchor such that they are placed on the specified boundary.
Be aware that since this repositions the start and end of the selection, this may not do what you want with TargetShape::BlockWise selections.
Trait Implementations§
source§impl Clone for SelectionAction
impl Clone for SelectionAction
source§fn clone(&self) -> SelectionAction
fn clone(&self) -> SelectionAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SelectionAction
impl Debug for SelectionAction
source§impl<I: ApplicationInfo> From<SelectionAction> for Action<I>
impl<I: ApplicationInfo> From<SelectionAction> for Action<I>
source§fn from(act: SelectionAction) -> Self
fn from(act: SelectionAction) -> Self
source§impl From<SelectionAction> for EditorAction
impl From<SelectionAction> for EditorAction
source§fn from(act: SelectionAction) -> Self
fn from(act: SelectionAction) -> Self
source§impl PartialEq for SelectionAction
impl PartialEq for SelectionAction
source§fn eq(&self, other: &SelectionAction) -> bool
fn eq(&self, other: &SelectionAction) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for SelectionAction
impl StructuralPartialEq for SelectionAction
Auto Trait Implementations§
impl Freeze for SelectionAction
impl RefUnwindSafe for SelectionAction
impl Send for SelectionAction
impl Sync for SelectionAction
impl Unpin for SelectionAction
impl UnwindSafe for SelectionAction
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.