diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-07-07 20:15:11 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-07-07 20:15:11 -0400 |
commit | b88ab3de01d6dfeb76967a9abcda1b79d10aa1b1 (patch) | |
tree | f1b6841e2b369769fff5d246fa25eed28a9596c0 /src/delta.rs | |
parent | 561f6fb4682a574d6dc015bb0b1aa541b2236e5f (diff) |
Fix line number padding
Fixes #238
Diffstat (limited to 'src/delta.rs')
-rw-r--r-- | src/delta.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/delta.rs b/src/delta.rs index 39835c2d..d1feb38b 100644 --- a/src/delta.rs +++ b/src/delta.rs @@ -375,6 +375,8 @@ fn handle_hunk_header_line( let (raw_code_fragment, line_numbers) = parse::parse_hunk_header(&line); painter.line_numbers_data.hunk_minus_line_number = line_numbers[0].0; painter.line_numbers_data.hunk_plus_line_number = line_numbers[line_numbers.len() - 1].0; + painter.line_numbers_data.hunk_max_line_number = + line_numbers.iter().map(|(n, d)| n + d).max().unwrap(); if config.hunk_header_style.is_raw { writeln!(painter.writer)?; draw_fn( |