mirror of
https://github.com/dandavison/delta.git
synced 2026-05-29 11:19:34 +02:00
Only trigger git show handler if a file extension was parsed (#1106)
Fixes #1105
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user