From cc90eae76f609e584f66cc72988f4156b3b2d539 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 25 Jun 2020 22:44:30 -0400 Subject: Fix state machine FileMeta parse bug --- src/delta.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/delta.rs b/src/delta.rs index 05180422..6473571b 100644 --- a/src/delta.rs +++ b/src/delta.rs @@ -94,7 +94,9 @@ where &minus_file, )); } - } else if line.starts_with("+++ ") || line.starts_with("rename to ") { + } else if (state == State::FileMeta || source == Source::DiffUnified) + && (line.starts_with("+++ ") || line.starts_with("rename to ")) + { plus_file = parse::get_file_path_from_file_meta_line(&line, source == Source::GitDiff); painter.set_syntax(parse::get_file_extension_from_file_meta_line_file_path( &plus_file, -- cgit v1.2.3