syntax_core 0.0.3
syntax_core: ^0.0.3 copied to clipboard
TextMate-grammar syntax highlighting in pure Dart. Tokenizes code with VS Code grammars and themes and renders tokens, diffs, HTML, or ANSI. No Flutter required.
0.0.3 #
SyntaxTheme.backgroundandforegroundstart from the editor colors. A theme whose first token setting names only a foreground, such as Monokai and Solarized Light, used to get a white background, so a dark theme drew its diff chrome on white.DiffColors.mutedis stronger, so@@lines and other diff labels reach 4.5:1 onhunkHeaderin the GitHub themes. They read 4.03:1 in GitHub Light. Catppuccin Latte, One Dark Pro, Solarized Light, Tokyo Night and Vitesse Light stay below 4.5:1 but improve.
0.0.2 #
HighlightedDiff.ofandHighlightedDiff.tokenizehonorbudgetfor parsed patches too, not only for diffs with full texts. A large patch is tokenized a slice at a time, the new side first, with the state carried across slices within a hunk and reset at each hunk as before; lines not tokenized yet are plain.PatchViewinsyntax_fluttertherefore colors long parsed patches between frames instead of in one blocking call.