EditorState class

LaTeX Editor State Machine.

Manages text content, cursor position, selection, parse results, and layout mapping. All state changes should occur through this class's methods to ensure consistency.

Note: Editor features are currently experimental, APIs may change in subsequent versions.

Inheritance

Constructors

EditorState(String initialText)

Properties

cursorOffset → int
Cursor offset in source code characters
no setter
document → DocumentNode
Parsed AST document
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
layoutMap → LayoutMap
Layout mapping table (populated by LatexEditor during measurement)
final
parseSuccess → bool
Whether parsing was successful
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selection → TextRange?
Selection range (null indicates no selection)
no setter
text → String
Current LaTeX text content
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
backspace() → void
Delete one character before the cursor (Backspace behavior)
delete() → void
Delete one character after the cursor (Delete behavior)
dispose() → void
Discards any resources used by the object.
inherited
insert(String insertion) → void
Insert text at the cursor position
insertTemplate(LatexTemplate template) → void
Insert a template and position the cursor at the template's placeholder
moveCursorLeft() → void
Move cursor left
moveCursorRight() → void
Move cursor right
moveCursorTo(int offset) → void
Move cursor to the specified offset
Navigate to the next Slot.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited
updateSelection(TextRange? range) → void
Set the selection
updateText(String newText) → void
Replace all text

Operators

operator ==(Object other) → bool
The equality operator.
inherited