Only trigger git show handler if a file extension was parsed (#1106)

Fixes #1105
This commit is contained in:
Dan Davison
2022-06-15 17:38:52 -04:00
committed by GitHub
parent e7dbdd4846
commit 29c9239ea5
+4 -2
View File
@@ -9,9 +9,11 @@ impl<'a> StateMachine<'a> {
self.painter.emit()?;
let mut handled_line = false;
if matches!(self.state, State::Unknown) {
if let process::CallingProcess::GitShow(_, extension) = &*process::calling_process() {
if let process::CallingProcess::GitShow(_, Some(extension)) =
&*process::calling_process()
{
self.state = State::GitShowFile;
self.painter.set_syntax(extension.as_deref());
self.painter.set_syntax(Some(extension));
self.painter.set_highlighter();
} else {
return Ok(handled_line);