Skip to content

Commit

Permalink
Only trigger git show handler if a file extension was parsed (#1106)
Browse files Browse the repository at this point in the history
Fixes #1105
  • Loading branch information
dandavison authored Jun 15, 2022
1 parent e7dbdd4 commit 29c9239
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/handlers/git_show_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29c9239

Please sign in to comment.