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
.