pub enum EditCommand {
Show 56 variants MoveToStart, MoveToLineStart, MoveToEnd, MoveToLineEnd, MoveLeft, MoveRight, MoveWordLeft, MoveBigWordLeft, MoveWordRight, MoveWordRightStart, MoveBigWordRightStart, MoveWordRightEnd, MoveBigWordRightEnd, MoveToPosition(usize), InsertChar(char), InsertString(String), InsertNewline, ReplaceChar(char), ReplaceChars(usizeString), 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(char), MoveRightBefore(char), CutLeftUntil(char), CutLeftBefore(char), MoveLeftUntil(char), MoveLeftBefore(char),
}
Expand description

Editing actions which can be mapped to key bindings.

Executed by Reedline::run_edit_commands()

Variants§

§

MoveToStart

Move to the start of the buffer

§

MoveToLineStart

Move to the start of the current line

§

MoveToEnd

Move to the end of the buffer

§

MoveToLineEnd

Move to the end of the current line

§

MoveLeft

Move one character to the left

§

MoveRight

Move one character to the right

§

MoveWordLeft

Move one word to the left

§

MoveBigWordLeft

Move one WORD to the left

§

MoveWordRight

Move one word to the right

§

MoveWordRightStart

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

§

MoveBigWordRightStart

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

§

MoveWordRightEnd

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

§

MoveBigWordRightEnd

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

§

MoveToPosition(usize)

Move to position

§

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(usizeString)

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(char)

CutUntil right until char

§

MoveRightBefore(char)

CutUntil right before char

§

CutLeftUntil(char)

CutUntil left until char

§

CutLeftBefore(char)

CutUntil left before char

§

MoveLeftUntil(char)

CutUntil left until char

§

MoveLeftBefore(char)

CutUntil left before char

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<EditCommand> 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 StructuralEq for EditCommand

source§

impl StructuralPartialEq for EditCommand

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere
    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 Twhere
    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 Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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