Skip to content

Commit

Permalink
Do not separate chunks that are less then predefined context_line apa…
Browse files Browse the repository at this point in the history
…rt (#74)

Do not separate chunks that are less then predefined context_line width apart

---------

Co-authored-by: hendrik <[email protected]>
Co-authored-by: Patrick Elsen <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 6b40a6d commit 2c47a9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ impl VersionDiff {
left_start,
right_start,
);
let overlaps_with_last_hunk =
hunk.0.start.max(last_hunk.0.start) <= hunk.0.end.min(last_hunk.0.end);
let overlaps_with_last_hunk = hunk.0.start.max(last_hunk.0.start)
<= hunk.0.end.min(last_hunk.0.end) + CONTEXT_LINES;
if overlaps_with_last_hunk {
last_hunk = (last_hunk.0.start..hunk.0.end, last_hunk.1, last_hunk.2);
} else {
Expand Down

0 comments on commit 2c47a9e

Please sign in to comment.