Add syntax highlighting on comments

Improves #32
better_inline
Wilfred Hughes 2022-01-23 11:07:16 +07:00
parent 119217e900
commit 6ff60bf0c5
2 changed files with 9 additions and 2 deletions

@ -4,6 +4,10 @@
Improved performance when all file changes are close together.
### Display
Added syntax highlighting for unchanged comments.
## 0.16 (released 22 January 2022)
### Parsing

@ -197,10 +197,13 @@ pub fn color_positions(is_lhs: bool, positions: &[MatchedPos]) -> Vec<(SingleLin
let line_pos = pos.pos;
let style = match pos.kind {
MatchKind::Unchanged { highlight, .. } => Style {
foreground: Color::White,
foreground: match highlight {
TokenKind::Atom(AtomKind::Comment) => Color::Blue,
_ => Color::White,
},
background: None,
bold: highlight == TokenKind::Atom(AtomKind::Keyword),
dimmed: highlight == TokenKind::Atom(AtomKind::Comment),
dimmed: false,
},
MatchKind::Novel { highlight, .. } => Style {
foreground: if is_lhs {