Skip to main content

Module query_highlight

Module query_highlight 

Source
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 #tag form, 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. base carries the background (and the style for any uncovered whitespace).