Expand description
Query syntax highlighting (spec §9): maps core’s query token spans onto theme roles. Reused by every query input — the FIND drawer now, the telescope modal in phase 08 — so the coloring rules live exactly once.
Core’s lexer (kimun_core::query_token_spans) owns tokenization; this
module only assigns styles, plus two presentation-layer overlays the core
grammar doesn’t know: {variable} placeholders and the leading ?
saved-search sigil.
Functions§
- emphasis_
needles - The lowercase emphasis needles a query implies: its plain text terms,
labels in their in-body
#tagform, and link targets — what a result’s content actually matched on. Shared by the telescope preview and the editor’s arrive-from-query emphasis. - error_
reason - The one-line reason for the query’s parse problem, if any — surfaced in the FIND header. The lenient grammar’s only real error is an unterminated quote.
- highlight_
line - Build the styled line for a query string.
basecarries the background (and the style for any uncovered whitespace).