TextAreaEditor
Category: Input
Source: text_area_editor.dart
Classes
TextAreaEditor
A multiline text editor with history, word-level movement, and standard Emacs-like keybindings.
Drop-in replacement for [LineEditor] — exposes the same public API (text, cursor, isEmpty, lastSubmitted, history, handle(), clear(), setText()) plus multiline getters (lines, cursorRow, cursorCol).
Properties
| Property | Type | Description |
|---|---|---|
text | String get | The current text as a flat string (lines joined by \n). |
isEmpty | bool get | Whether the editor is empty. |
lastSubmitted | String get | The text from the most recent submit. |
history | List<String> get | The input history (read-only). |
lines | List<String> get | The logical lines of text. |
cursorRow | int get | The cursor's row (0-indexed into [lines]). |
cursorCol | int get | The cursor's column (0-indexed into the current line). |
isMultiline | bool get | Whether the editor contains multiple lines. |
text | String get | The current text as a flat string (lines joined by \n). |
cursor | int get | The cursor as a flat character offset (for autocomplete compatibility). |
isEmpty | bool get | Whether the editor is empty. |
lastSubmitted | String get | The text from the most recent submit. |
history | List<String> get | The input history (read-only). |
lines | List<String> get | The logical lines of text. |
cursorRow | int get | The cursor's row (0-indexed into [lines]). |
cursorCol | int get | The cursor's column (0-indexed into the current line). |
isMultiline | bool get | Whether the editor contains multiple lines. |
Methods
InputAction? handle(TerminalEvent event)
Process a [TerminalEvent] and return the resulting action, or null if the event was not consumed.
void clear()
Clear the buffer and reset cursor position.
void setText(String text, {int? cursor})
Programmatically set the buffer text and cursor position.
Used by autocomplete to accept a completion. The [cursor] parameter is a flat offset (same convention as LineEditor).