Enum reedline::EditCommand

source ·
#[non_exhaustive]
pub enum EditCommand {
Show 60 variants MoveToStart { select: bool, }, MoveToLineStart { select: bool, }, MoveToEnd { select: bool, }, MoveToLineEnd { select: bool, }, MoveLeft { select: bool, }, MoveRight { select: bool, }, MoveWordLeft { select: bool, }, MoveBigWordLeft { select: bool, }, MoveWordRight { select: bool, }, MoveWordRightStart { select: bool, }, MoveBigWordRightStart { select: bool, }, MoveWordRightEnd { select: bool, }, MoveBigWordRightEnd { select: bool, }, MoveToPosition { position: usize, select: bool, }, InsertChar(char), InsertString(String), InsertNewline, ReplaceChar(char), ReplaceChars(usize, String), Backspace, Delete, CutChar, BackspaceWord, DeleteWord, Clear, ClearToLineEnd, Complete, CutCurrentLine, CutFromStart, CutFromLineStart, CutToEnd, CutToLineEnd, CutWordLeft, CutBigWordLeft, CutWordRight, CutBigWordRight, CutWordRightToNext, CutBigWordRightToNext, PasteCutBufferBefore, PasteCutBufferAfter, UppercaseWord, LowercaseWord, CapitalizeChar, SwitchcaseChar, SwapWords, SwapGraphemes, Undo, Redo, CutRightUntil(char), CutRightBefore(char), MoveRightUntil { c: char, select: bool, }, MoveRightBefore { c: char, select: bool, }, CutLeftUntil(char), CutLeftBefore(char), MoveLeftUntil { c: char, select: bool, }, MoveLeftBefore { c: char, select: bool, }, SelectAll, CutSelection, CopySelection, Paste,
}
Expand description

Editing actions which can be mapped to key bindings.

Executed by Reedline::run_edit_commands()

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MoveToStart

Move to the start of the buffer

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveToLineStart

Move to the start of the current line

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveToEnd

Move to the end of the buffer

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveToLineEnd

Move to the end of the current line

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveLeft

Move one character to the left

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveRight

Move one character to the right

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveWordLeft

Move one word to the left

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveBigWordLeft

Move one WORD to the left

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveWordRight

Move one word to the right

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveWordRightStart

Move one word to the right, stop at start of word

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveBigWordRightStart

Move one WORD to the right, stop at start of WORD

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveWordRightEnd

Move one word to the right, stop at end of word

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveBigWordRightEnd

Move one WORD to the right, stop at end of WORD

Fields

§select: bool

Select the text between the current cursor position and destination

§

MoveToPosition

Move to position

Fields

§position: usize

Position to move to

§select: bool

Select the text between the current cursor position and destination

§

InsertChar(char)

Insert a character at the current insertion point

§

InsertString(String)

Insert a string at the current insertion point

§

InsertNewline

Inserts the system specific new line character

  • On Unix systems LF ("\n")
  • On Windows CRLF ("\r\n")
§

ReplaceChar(char)

Replace a character

§

ReplaceChars(usize, String)

Replace characters with string

§

Backspace

Backspace delete from the current insertion point

§

Delete

Delete in-place from the current insertion point

§

CutChar

Cut the grapheme right from the current insertion point

§

BackspaceWord

Backspace delete a word from the current insertion point

§

DeleteWord

Delete in-place a word from the current insertion point

§

Clear

Clear the current buffer

§

ClearToLineEnd

Clear to the end of the current line

§

Complete

Insert completion: entire completion if there is only one possibility, or else up to shared prefix.

§

CutCurrentLine

Cut the current line

§

CutFromStart

Cut from the start of the buffer to the insertion point

§

CutFromLineStart

Cut from the start of the current line to the insertion point

§

CutToEnd

Cut from the insertion point to the end of the buffer

§

CutToLineEnd

Cut from the insertion point to the end of the current line

§

CutWordLeft

Cut the word left of the insertion point

§

CutBigWordLeft

Cut the WORD left of the insertion point

§

CutWordRight

Cut the word right of the insertion point

§

CutBigWordRight

Cut the word right of the insertion point

§

CutWordRightToNext

Cut the word right of the insertion point and any following space

§

CutBigWordRightToNext

Cut the WORD right of the insertion point and any following space

§

PasteCutBufferBefore

Paste the cut buffer in front of the insertion point (Emacs, vi P)

§

PasteCutBufferAfter

Paste the cut buffer in front of the insertion point (vi p)

§

UppercaseWord

Upper case the current word

§

LowercaseWord

Lower case the current word

§

CapitalizeChar

Capitalize the current character

§

SwitchcaseChar

Switch the case of the current character

§

SwapWords

Swap the current word with the word to the right

§

SwapGraphemes

Swap the current grapheme/character with the one to the right

§

Undo

Undo the previous edit command

§

Redo

Redo an edit command from the undo history

§

CutRightUntil(char)

CutUntil right until char

§

CutRightBefore(char)

CutUntil right before char

§

MoveRightUntil

CutUntil right until char

Fields

§c: char

Char to move towards

§select: bool

Select the text between the current cursor position and destination

§

MoveRightBefore

CutUntil right before char

Fields

§c: char

Char to move towards

§select: bool

Select the text between the current cursor position and destination

§

CutLeftUntil(char)

CutUntil left until char

§

CutLeftBefore(char)

CutUntil left before char

§

MoveLeftUntil

Move left until char

Fields

§c: char

Char to move towards

§select: bool

Select the text between the current cursor position and destination

§

MoveLeftBefore

Move left before char

Fields

§c: char

Char to move towards

§select: bool

Select the text between the current cursor position and destination

§

SelectAll

Select whole input buffer

§

CutSelection

Cut selection to local buffer

§

CopySelection

Copy selection to local buffer

§

Paste

Paste content from local buffer at the current cursor position

Implementations§

source§

impl EditCommand

source

pub fn edit_type(&self) -> EditType

Determine if a certain operation should be undoable or if the operations should be coalesced for undoing

Trait Implementations§

source§

impl Clone for EditCommand

source§

fn clone(&self) -> EditCommand

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EditCommand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for EditCommand

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for EditCommand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl IntoEnumIterator for EditCommand

§

type Iterator = EditCommandIter

source§

fn iter() -> EditCommandIter

source§

impl PartialEq for EditCommand

source§

fn eq(&self, other: &EditCommand) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for EditCommand

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for EditCommand

source§

impl StructuralPartialEq for EditCommand

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,