Enum modalkit::actions::EditAction
source · pub enum EditAction {
Motion,
Delete,
Yank,
Replace(bool),
Format,
ChangeNumber(NumberChange, bool),
Join(JoinStyle),
Indent(IndentChange),
ChangeCase(Case),
}
Expand description
The various actions that can be taken on text.
Variants§
Motion
Move the cursor.
If a shape is specified contextually, then visually select text while moving, as if using SelectionAction::Resize with SelectionResizeStyle::Extend.
Delete
Delete the targeted text.
Yank
Yank the targeted text into a Register.
Replace(bool)
Replace characters within the targeted text with a new character.
If bool is true, virtually replace characters by how many columns they occupy.
Format
Automatically format the targeted text.
ChangeNumber(NumberChange, bool)
Change the first number on each line within the targeted text.
The bool argument controls whether to increment by an additional count on each line.
Join(JoinStyle)
Join the lines within the targeted text together.
If bool is true, modify spacing when joining.
Indent(IndentChange)
Change the indent level of the targeted text.
ChangeCase(Case)
Change the case of the targeted text.
Implementations§
source§impl EditAction
impl EditAction
sourcepub fn is_readonly(&self) -> bool
pub fn is_readonly(&self) -> bool
Returns true if this EditAction doesn’t modify a buffer’s text.
sourcepub fn is_motion(&self) -> bool
pub fn is_motion(&self) -> bool
Returns true if the value is EditAction::Motion.
sourcepub fn is_switchable(&self, _: &EditContext) -> bool
pub fn is_switchable(&self, _: &EditContext) -> bool
Returns true if this EditAction is allowed to trigger a WindowAction::Switch after an error.
Trait Implementations§
source§impl Clone for EditAction
impl Clone for EditAction
source§fn clone(&self) -> EditAction
fn clone(&self) -> EditAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EditAction
impl Debug for EditAction
source§impl Default for EditAction
impl Default for EditAction
source§fn default() -> EditAction
fn default() -> EditAction
source§impl PartialEq for EditAction
impl PartialEq for EditAction
source§fn eq(&self, other: &EditAction) -> bool
fn eq(&self, other: &EditAction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Resolve<Specifier<EditAction>, EditAction> for EditContext
impl Resolve<Specifier<EditAction>, EditAction> for EditContext
source§fn resolve(&self, mark: &Specifier<EditAction>) -> EditAction
fn resolve(&self, mark: &Specifier<EditAction>) -> EditAction
T
into an R
.impl Eq for EditAction
impl StructuralPartialEq for EditAction
Auto Trait Implementations§
impl Freeze for EditAction
impl RefUnwindSafe for EditAction
impl Send for EditAction
impl Sync for EditAction
impl Unpin for EditAction
impl UnwindSafe for EditAction
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.