Skip to content

Commit

Permalink
Do not separate chunks that are less then predefined context_line wid…
Browse files Browse the repository at this point in the history
…th apart
  • Loading branch information
HWienhold committed Oct 23, 2024
1 parent 4c49a56 commit e7db5a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl VersionDiff {
for offset in offsets.iter() {
let hunk = offset.saturating_sub(CONTEXT_LINES)..*offset + CONTEXT_LINES + 1;
let overlaps_with_last_hunk =
hunk.start.max(last_hunk.start) <= hunk.end.min(last_hunk.end);
hunk.start.max(last_hunk.start) <= hunk.end.min(last_hunk.end) + CONTEXT_LINES;
if overlaps_with_last_hunk {
last_hunk = last_hunk.start..hunk.end;
} else {
Expand Down

0 comments on commit e7db5a2

Please sign in to comment.