From 80aeae48b513654dab055240a57b9cc3179f9eee Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 5 Feb 2022 15:43:37 -0800 Subject: [PATCH] cli: fix git diff to not add context lines to count twice We add `num_after_lines` to the line ranges just a few lines before the place I removed the addition from in this patch. --- src/commands.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 951417906..6feff097a 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -2254,10 +2254,8 @@ fn unified_diff_hunks<'content>( .saturating_sub(num_after_lines) .saturating_sub(num_context_lines); if num_skip_lines > 0 { - let left_start = - current_hunk.left_line_range.end + num_after_lines + num_skip_lines; - let right_start = - current_hunk.right_line_range.end + num_after_lines + num_skip_lines; + let left_start = current_hunk.left_line_range.end + num_skip_lines; + let right_start = current_hunk.right_line_range.end + num_skip_lines; if !current_hunk.lines.is_empty() { hunks.push(current_hunk); }