Skip to content

Commit b2454ca

Browse files
committed
Fix legacy hard-coded context value
1 parent 9b5e8ec commit b2454ca

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jemalloc was only disabled for MSVC.
1818
Improved error reporting when invoked with an invalid number of
1919
arguments.
2020

21+
### Display
22+
23+
Fixed an issue with inline display where it didn't always respect the
24+
value of --context.
25+
2126
## 0.67 (released 16 November 2025)
2227

2328
### Parsing

src/display/inline.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ pub(crate) fn print(
7979

8080
let hunk_lines = hunk.lines.clone();
8181

82-
let before_lines =
83-
calculate_before_context(&hunk_lines, &opposite_to_lhs, &opposite_to_rhs, 3);
82+
let before_lines = calculate_before_context(
83+
&hunk_lines,
84+
&opposite_to_lhs,
85+
&opposite_to_rhs,
86+
display_options.num_context_lines as usize,
87+
);
8488
let after_lines = calculate_after_context(
8589
&[&before_lines[..], &hunk_lines[..]].concat(),
8690
&opposite_to_lhs,

0 commit comments

Comments
 (0)