pub enum CursorCommand {
Show 20 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,
},
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
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