UI module

Highlight_Proc

typeextensionexperimentalsince 0.31.0Source

A procedure that colours one line of text by appending spans (unlisted text uses the default colour).

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) });
    }
}

options := Editor_Options.{ highlight = paint_comments };

This one is only checked to compile, not run.

Highlight_Proc :: #type (line: string, spans: *[..] Highlight_Span)

See also