Skip to main content

Module highlight

Module highlight 

Source
Expand description

Whole-file syntax highlighting via tree-sitter, sliced into per-line styled ranges. Highlighting whole files (not hunks) keeps multi-line constructs like strings correct across hunk boundaries. Unknown languages and parse failures degrade to plain (empty) ranges so rendering never breaks.

Structs§

Highlighter
StyledRange
Foreground color + style for a byte range of one line.

Enums§

SyntaxTheme
Syntax-highlight palette, paired with a UI theme so foreground colors stay legible against the diff backgrounds (a dark UI needs dark-theme syntax, a light UI light-theme syntax).