diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-25 22:44:30 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-25 22:50:57 -0400 |
commit | cc90eae76f609e584f66cc72988f4156b3b2d539 (patch) | |
tree | 2c94990b5d0113e81fd0c790edad4929079041db /src/delta.rs | |
parent | 13ce5619d2ac96285714e8664a829f222951be17 (diff) |
Fix state machine FileMeta parse bug
Diffstat (limited to 'src/delta.rs')
-rw-r--r-- | src/delta.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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, |