Skip to content

Commit

Permalink
Recreate highlighter on each line of git show $commit:$path output (#…
Browse files Browse the repository at this point in the history
…1127)

Prior to this commit, syntax highlighting of scala code was not
correct in `git show $commit:$path` output. It was working for other
languages as far as I know. I'm not sure why.
  • Loading branch information
dandavison authored Jul 15, 2022
1 parent f3b6c45 commit f556db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/git_show_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ impl<'a> StateMachine<'a> {
{
self.state = State::GitShowFile;
self.painter.set_syntax(Some(extension));
self.painter.set_highlighter();
} else {
return Ok(handled_line);
}
}
if matches!(self.state, State::GitShowFile) {
self.painter.set_highlighter();
self.painter.syntax_highlight_and_paint_line(
&self.line,
StyleSectionSpecifier::Style(self.config.zero_style),
Expand Down

0 comments on commit f556db8

Please sign in to comment.