pub enum EditCommand {
Insert {
offset: usize,
text: String,
},
Delete {
start: usize,
length: usize,
},
Replace {
start: usize,
length: usize,
text: String,
},
InsertText {
text: String,
},
Backspace,
DeleteForward,
Undo,
Redo,
EndUndoGroup,
ReplaceCurrent {
query: String,
replacement: String,
options: SearchOptions,
},
ReplaceAll {
query: String,
replacement: String,
options: SearchOptions,
},
}Expand description
Text editing commands
Variants§
Insert
Insert text at the specified position
Delete
Delete text in specified range
Fields
Replace
Replace text in specified range
Fields
InsertText
VSCode-like typing/paste: apply to all carets/selections (primary + secondary)
Backspace
Backspace-like deletion: delete selection(s) if any, otherwise delete 1 char before each caret.
DeleteForward
Delete key-like deletion: delete selection(s) if any, otherwise delete 1 char after each caret.
Undo
Undo last edit operation (supports grouping)
Redo
Redo last undone operation (supports grouping)
EndUndoGroup
Explicitly end the current undo group (for idle or external boundaries)
ReplaceCurrent
Replace the current occurrence of query (based on selection/caret) with replacement.
- Honors
options(case sensitivity / whole-word / regex). - Treated as a single undoable edit.
Fields
§
options: SearchOptionsSearch options (case sensitivity, whole-word, regex).
ReplaceAll
Replace all occurrences of query with replacement.
- Honors
options(case sensitivity / whole-word / regex). - Treated as a single undoable edit.
Trait Implementations§
Source§impl Clone for EditCommand
impl Clone for EditCommand
Source§fn clone(&self) -> EditCommand
fn clone(&self) -> EditCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditCommand
impl Debug for EditCommand
Source§impl PartialEq for EditCommand
impl PartialEq for EditCommand
impl Eq for EditCommand
impl StructuralPartialEq for EditCommand
Auto Trait Implementations§
impl Freeze for EditCommand
impl RefUnwindSafe for EditCommand
impl Send for EditCommand
impl Sync for EditCommand
impl Unpin for EditCommand
impl UnwindSafe for EditCommand
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
Mutably borrows from an owned value. Read more