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§
- Rich
Text Line - 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§
- chip_
mono_ width - Pulled out as a free function so the chip-sizing math is unit-testable independent of the full draw path.
- link_
at_ byte - Used by
MainPanel::handle_eventto route clicks on link spans to the page-navigation handler.