pub enum CursorCommand {
Show 27 variants
MoveTo {
line: usize,
column: usize,
},
MoveBy {
delta_line: isize,
delta_column: isize,
},
MoveVisualBy {
delta_rows: isize,
},
MoveToVisual {
row: usize,
x_cells: usize,
},
MoveToLineStart,
MoveToLineEnd,
MoveToVisualLineStart,
MoveToVisualLineEnd,
MoveGraphemeLeft,
MoveGraphemeRight,
MoveWordLeft,
MoveWordRight,
SetSelection {
start: Position,
end: Position,
},
ExtendSelection {
to: Position,
},
ClearSelection,
SetSelections {
selections: Vec<Selection>,
primary_index: usize,
},
ClearSecondarySelections,
SetRectSelection {
anchor: Position,
active: Position,
},
SelectLine,
SelectWord,
ExpandSelection,
AddCursorAbove,
AddCursorBelow,
AddNextOccurrence {
options: SearchOptions,
},
AddAllOccurrences {
options: SearchOptions,
},
FindNext {
query: String,
options: SearchOptions,
},
FindPrev {
query: String,
options: SearchOptions,
},
}Expand description
Cursor & selection commands
Variants§
MoveTo
Move cursor to the specified position
Fields
MoveBy
Move cursor relatively
MoveVisualBy
Move cursor by visual rows (soft wrap + folding aware).
This uses a “preferred x” in cells (sticky column) similar to many editors: horizontal moves update preferred x, while vertical visual moves try to preserve it.
MoveToVisual
Move cursor to a visual position (global visual row + x in cells).
Fields
MoveToLineStart
Move cursor to the start of the current logical line.
MoveToLineEnd
Move cursor to the end of the current logical line.
MoveToVisualLineStart
Move cursor to the start of the current visual line segment (wrap-aware).
MoveToVisualLineEnd
Move cursor to the end of the current visual line segment (wrap-aware).
MoveGraphemeLeft
Move cursor left by one Unicode grapheme cluster (UAX #29).
MoveGraphemeRight
Move cursor right by one Unicode grapheme cluster (UAX #29).
MoveWordLeft
Move cursor left to the previous Unicode word boundary (UAX #29).
MoveWordRight
Move cursor right to the next Unicode word boundary (UAX #29).
SetSelection
Set selection range
ExtendSelection
Extend selection range
ClearSelection
Clear selection
SetSelections
Set multiple selections/multi-cursor (including primary)
Fields
ClearSecondarySelections
Clear secondary selections/cursors, keeping only primary
SetRectSelection
Set rectangular selection (box/column selection), which expands into one Selection per line
Fields
SelectLine
Select the entire current line (or the set of lines covered by the selection), for all carets.
SelectWord
Select the word under each caret (or keep existing selections if already non-empty).
ExpandSelection
Expand selection in a basic, editor-friendly way.
- If the selection is empty, expands to the word under the caret.
- If the selection is non-empty, expands to full line(s).
AddCursorAbove
Add a new caret above each existing caret/selection (at the same column, clamped to line length).
AddCursorBelow
Add a new caret below each existing caret/selection (at the same column, clamped to line length).
AddNextOccurrence
Multi-cursor match op: add the next occurrence of the current selection/word as a new selection.
Fields
options: SearchOptionsSearch options (case sensitivity, whole-word, regex).
AddAllOccurrences
Multi-cursor match op: select all occurrences of the current selection/word.
Fields
options: SearchOptionsSearch options (case sensitivity, whole-word, regex).
FindNext
Find the next occurrence of query and select it (primary selection only).
Fields
options: SearchOptionsSearch options (case sensitivity, whole-word, regex).
FindPrev
Find the previous occurrence of query and select it (primary selection only).
Fields
options: SearchOptionsSearch options (case sensitivity, whole-word, regex).
Trait Implementations§
Source§impl Clone for CursorCommand
impl Clone for CursorCommand
Source§fn clone(&self) -> CursorCommand
fn clone(&self) -> CursorCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more