From 85b38236aacc2ac89b553ead01073bbd161fe373 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 11 Jul 2022 22:24:43 -0400 Subject: [PATCH] Recreate highlighter on each line of `git show $commit:$path` output 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. --- src/handlers/git_show_file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/git_show_file.rs b/src/handlers/git_show_file.rs index 13a0947ce..a9e1358ea 100644 --- a/src/handlers/git_show_file.rs +++ b/src/handlers/git_show_file.rs @@ -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),