pub enum Action {
Show 46 variants
Type(char),
Backspace,
Delete,
DeleteWordBack,
DeleteWordForward,
Enter,
Tab,
Outdent,
ToggleComment,
DeleteLine,
InsertLine {
down: bool,
},
Cut,
Paste {
text: String,
entire_line: bool,
},
Move {
motion: Motion,
extend: bool,
},
PlaceCaret(u32),
DragSelect {
granularity: Granularity,
origin: u32,
head: u32,
},
AddCaret(u32),
AddNextOccurrence,
SelectAllOccurrences,
AddCaretVertical {
down: bool,
},
JumpToBracket,
ExpandSelection,
ShrinkSelection,
Collapse,
SelectAll,
Undo,
Redo,
ColumnSelect(ColumnDir),
ColumnDrag {
anchor: (u32, u32),
active: (u32, u32),
},
MoveLine {
down: bool,
},
CopyLine {
down: bool,
},
ViewportChanged(Range<u32>),
PopupUp,
PopupDown,
PopupAccept,
PopupClickAccept(u32),
PopupDismiss,
SnippetTab,
SnippetTabPrev,
SnippetCancel,
SignatureClose,
NextDiagnostic {
forward: bool,
},
HoverQuery(u32),
HoverDismiss,
ToggleFold {
opener: u32,
},
FoldAtCarets {
unfold: bool,
},
}Expand description
A semantic editor action produced by the widget for the app to apply to its
Document — an edit verb or a caret motion.
Variants§
Type(char)
Insert a typed character (replacing any selection).
Backspace
Backspace.
Delete
Forward delete.
DeleteWordBack
Delete the word before the caret (Ctrl+Backspace).
DeleteWordForward
Delete the word after the caret (Ctrl+Delete).
Enter
Split the line (Enter).
Tab
Indent / insert-to-tab-stop (Tab).
Outdent
Outdent to the previous tab stop (Shift+Tab).
ToggleComment
Toggle the language’s line comment on the spanned lines (Ctrl+/).
DeleteLine
Delete each selection’s whole-line block (Ctrl+Shift+K).
InsertLine
Open a fresh indent-carrying line below (Ctrl+Enter) or above (Ctrl+Shift+Enter) the caret’s line, caret landing on it.
Cut
Cut’s edit half (the copy half runs in the widget): delete each selection, an empty caret expanding to its whole line.
Paste
Insert clipboard text at the carets (Paste).
Fields
Move
Move (or, with extend, drag) every caret.
PlaceCaret(u32)
Place a single caret at a byte offset (mouse click).
DragSelect
Drag-select from origin to head at a granularity — the click-drag
family. head == origin is the double/triple-click initial selection;
Word/Line drags extend by whole units keeping the origin unit selected.
Fields
granularity: GranularityCharacter / word / line units.
AddCaret(u32)
Add a caret at a byte offset (Alt+Click), keeping existing selections.
AddNextOccurrence
Add the next occurrence of the selection as a new caret (Ctrl+D).
SelectAllOccurrences
Select every occurrence of the selection (Ctrl+Shift+L).
AddCaretVertical
Add a caret one display row above/below every caret (Ctrl+Alt+↑/↓).
JumpToBracket
Jump each caret to its matching bracket (Ctrl+Shift+).
ExpandSelection
Grow each selection one structural step (Shift+Alt+Right).
ShrinkSelection
Walk back down the expansion ladder (Shift+Alt+Left).
Collapse
Collapse a multi-cursor set (or a range) to the primary caret (Escape).
SelectAll
Select the whole document (Ctrl+A).
Undo
Undo the last edit (Ctrl+Z).
Redo
Redo the last undone edit (Ctrl+Shift+Z / Ctrl+Y).
ColumnSelect(ColumnDir)
Grow/shrink the column (box) selection (Ctrl+Shift+Alt+Arrow).
ColumnDrag
Mouse box (column) selection drag (Shift+Alt+drag): corners as
(visible buffer row, virtual display cell) — the core resolves the
cells per spanned display row and clamps each to its line.
Fields
MoveLine
Move the selected line-block up/down (Alt+↑/↓).
CopyLine
Duplicate the selected line-block above/below (Shift+Alt+↑/↓).
ViewportChanged(Range<u32>)
The visible buffer-row range changed (scroll / resize / autoscroll),
margin included. The app aims the highlight retention window here
(Document::set_highlight_window) and tokenizes highlights down to its
end — the view reports its viewport to the model so highlighting only
ever runs for what is on screen (see update). Not an edit: it never
moves a caret or touches history.
PopupUp
Move the completion popup’s selection up / down. Published (and the key captured) only while the popup is open; the app drives the controller.
PopupDown
See PopupUp.
PopupAccept
Accept the popup’s selected item (Enter / Tab).
PopupClickAccept(u32)
Accept the popup row at this filtered-list index (a mouse click on it).
PopupDismiss
Dismiss the popup (Escape) — sticky until a word boundary.
SnippetTab
Advance / retreat the active snippet tab stop (Tab / Shift+Tab). Captured only while a session is active; the app drives it.
SnippetTabPrev
See SnippetTab.
SnippetCancel
Cancel the snippet session (Escape).
SignatureClose
Close the signature-help box (Escape — after the popup, before the snippet session, in dismissal order).
NextDiagnostic
Jump to the next/previous diagnostic (F8 / Shift+F8).
HoverQuery(u32)
The pointer rested over byte offset long enough for a hover query.
The app resolves the word + queries its provider.
HoverDismiss
Close the hover popup (pointer left the word).
ToggleFold
Toggle the fold whose pair opens at byte offset opener — a
gutter-chevron click or Ctrl+Shift+[/]. The app calls
Document::toggle_fold_opener; not an edit (folds are view state, never on
the undo stack). Keyed by the opener so a single-line row with two [..]
pairs stays unambiguous.
FoldAtCarets
Fold (unfold == false) or unfold (unfold == true) the block at EVERY
caret — Ctrl+Shift+[ / Ctrl+Shift+]. The app calls
Document::fold_at_carets; not an edit (folds are view state). Distinct
from Action::ToggleFold, which acts on one gutter-clicked opener.
Trait Implementations§
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.