UI module

Highlight_Span

structextensionexperimentalsince 0.31.0Source

A coloured range of one line, produced by an editor's highlight procedure.

Example↗
paint_comments :: (line: string, spans: *[..] Highlight_Span) {
    if line.count >= 2 && line[0] == #char "/" && line[1] == #char "/" {
        array_add(spans, .{ 0, line.count, rgb(120, 140, 120) });
    }
}

This one is only checked to compile, not run.

Fields

start: int
byte offsets within the line
end: int
color: Color

See also