pub enum Command {
Show 33 variants
Move(Dir),
MoveLineStart,
MoveLineEnd,
Tab,
ShiftTab,
MoveTo(CaretPath),
Extend(Dir),
ExtendTo(CaretPath),
SelectAll,
Collapse,
InsertAtom(Symbol),
InsertHostBox(u32),
InsertText(String),
InsertFraction(FracStyle),
InsertScript(ScriptSlot),
InsertBigOp(Symbol),
InsertSqrt,
InsertDelimiters {
open: char,
close: char,
},
InsertAccent(Mark),
InsertUnderOver(UnderOverSpec),
InsertStyled(Variant),
InsertMatrix {
env: MatrixEnv,
rows: usize,
cols: usize,
},
InsertDocument(Document),
DeleteBackward,
DeleteForward,
MatrixInsertRow(Side),
MatrixDeleteRow,
MatrixInsertCol(Side),
MatrixDeleteCol,
Confirm,
MenuSelect(usize),
ReplaceTyped {
typed: String,
with: Vec<Command>,
},
CloseDelimiter(char),
}Expand description
An editor command.
Variants§
Move(Dir)
Move the caret.
MoveLineStart
Move to the start of the caret’s sequence.
MoveLineEnd
Move to the end of the caret’s sequence.
Tab
Move to the next empty slot.
ShiftTab
Move to the previous empty slot.
MoveTo(CaretPath)
Place the caret, usually at a Editor::hit_test result.
Extend(Dir)
Extend the selection by one step.
ExtendTo(CaretPath)
Extend the selection to a caret, promoting across structures.
SelectAll
Select the whole formula.
Collapse
Collapse the selection, or close the menu.
InsertAtom(Symbol)
Insert a symbol atom, replacing the selection.
InsertHostBox(u32)
Insert an opaque host box carrying a host minted token, refused above crate::MAX_HOST_TOKEN.
InsertText(String)
Insert each character as an atom, spaces are kept only in text slots.
InsertFraction(FracStyle)
Insert a fraction, wrapping the selection into the numerator.
InsertScript(ScriptSlot)
Attach a script to the item left of the caret, or wrap the selection as the base.
InsertBigOp(Symbol)
Insert a big operator with empty limits, replacing the selection.
InsertSqrt
Insert a radical, wrapping the selection into the radicand.
InsertDelimiters
Insert stretchy delimiters, wrapping the selection into the body.
InsertAccent(Mark)
Insert an accent, wrapping the selection into its base.
InsertUnderOver(UnderOverSpec)
Insert an under or over construct, wrapping the selection into its base.
InsertStyled(Variant)
Insert a styled run, wrapping the selection into it.
InsertMatrix
Insert a matrix, replacing the selection.
Fields
InsertDocument(Document)
Paste a document at the caret, replacing the selection, refused when it fails validation.
DeleteBackward
Delete backward, selecting or opening the menu next to a structure first.
DeleteForward
Delete forward, selecting or opening the menu next to a structure first.
MatrixInsertRow(Side)
Insert a matrix row next to the caret’s row.
MatrixDeleteRow
Delete the caret’s matrix row.
MatrixInsertCol(Side)
Insert a matrix column next to the caret’s column.
MatrixDeleteCol
Delete the caret’s matrix column.
Confirm
Commit the highlighted menu row, or collapse when no menu is open.
MenuSelect(usize)
Commit a visible menu row by index.
ReplaceTyped
When the atoms left of the caret spell typed, delete them and run with.
Fields
typed: StringCharacters to match, compared through Symbol::from_char.
CloseDelimiter(char)
Leave the innermost matching delimiters when at their end, else insert the character.