syntax_noir library
Terminal widgets for syntax on noir: syntax highlighting with TextMate grammars and VS Code themes.
- SyntaxCodeHighlighter highlights noir's
CodeView. - PatchView shows a diff or patch, unified or split.
- PatchPainter paints diff rows, for building your own view.
- noirColor and noirTextStyle convert syntax's colors and styles.
noir and syntax both export DiffLine, DiffHunk and DiffLineKind,
so import syntax with a prefix:
import 'package:noir/noir.dart';
import 'package:syntax_core/syntax.dart' as syntax;
import 'package:syntax_noir/syntax_noir.dart';
Classes
- PatchPainter
-
Paints the rows from syntax's
layoutDiffas noir text, one terminal line per row. - PatchView
- A syntax-highlighted view of code changes for the terminal.
- SyntaxCodeHighlighter
-
A noir
CodeHighlighterbacked by syntax, for noir'sCodeView.
Functions
-
noirColor(
int argb, {int? over}) → Color -
An ARGB color from syntax as a noir
Color. Terminals don't blend, so a translucent color is first painted overoverwhen given. -
noirTextStyle(
TokenStyle style, {required int background}) → TextStyle -
A syntax token style as a noir
TextStyle. Translucent colors are painted overbackground, the color behind the text. The style sets a background only when the token has its own.