Module rich_text_line
Expand description
A single editable line of text wrapping a local-mode TextInput, the
leaf cell of a block editor. The inner TextInput handles cursor
placement, selection, IME, copy/paste; RichTextLine adds:
- Intercepts Enter, Backspace at byte 0, Up at the start, and Down at the
end before the inner input sees them, queuing
LineSignals the parent (crate::widget::block_editor::BlockEditor) consumes instead. - A per-line font size so a block editor can render H1/H2/H3 headings without forking the widget.
- A
MarkSpanlist (inline bold/italic/code/link) with rendering and Ctrl-B/I/E toggling built on the innerTextInput’s selection range.
Structs§
- Declared
Line - A rich text line driven from a view: what it types edits the bound text, and the keys that leave the line reach the view’s events.
- Rich
Text Line - Rich
Text Line Props - One line of text, edited in place: a block editor’s cell, a composer’s message. It carries its text and its inline marks, and reports the keys that would carry the edit out of the line itself (Enter, Shift+Enter, Backspace at the start), so a host composing several lines can split or join them.
- Transient
Color Span - A presentation-only syntax colour over a byte range of the line, painted
from the theme’s
SyntaxPaletteand never written to the document.
Enums§
- Line
Signal - Emitted when a key would carry the edit out of the line itself; the
parent (a
BlockEditor) drains these viaRichTextLine::take_signal.
Functions§
- link_
at_ byte - Used by
MainPanel::handle_eventto route clicks on link spans to the page-navigation handler.