Skip to content

Commit

Permalink
Pass --context option to "before" lines of inline diffs
Browse files Browse the repository at this point in the history
Perhaps, this was just an oversight.

BTW, inline diffs print one more context lines than specified, which I'll fix
separately.
  • Loading branch information
yuja committed Jun 13, 2024
1 parent 55a36aa commit 589b226
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/display/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ pub(crate) fn print(

let hunk_lines = &hunk.lines;

let before_lines =
calculate_before_context(hunk_lines, &opposite_to_lhs, &opposite_to_rhs, 3);
let before_lines = calculate_before_context(
hunk_lines,
&opposite_to_lhs,
&opposite_to_rhs,
display_options.num_context_lines as usize,
);
let after_lines = calculate_after_context(
&[&before_lines[..], &hunk_lines[..]].concat(),
&opposite_to_lhs,
Expand Down

0 comments on commit 589b226

Please sign in to comment.