Skip to content

Commit

Permalink
Add file path to hunk header
Browse files Browse the repository at this point in the history
Fixes #309
  • Loading branch information
dandavison committed Oct 5, 2020
1 parent 31e2661 commit d0849a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/delta.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::borrow::Cow;
use std::fmt::Write as FmtWrite;
use std::io::BufRead;
use std::io::Write;

Expand Down Expand Up @@ -437,6 +438,7 @@ fn handle_hunk_header_line(
s => s,
};
writeln!(painter.writer)?;
let _ = write!(&mut painter.output_buffer, "{}: ", plus_file);
if !line.is_empty() {
let lines = vec![(line, State::HunkHeader)];
let syntax_style_sections = Painter::get_syntax_style_sections_for_lines(
Expand Down

0 comments on commit d0849a3

Please sign in to comment.