From e7db5a261e3bea32f33050b15f2a8ca304c46464 Mon Sep 17 00:00:00 2001 From: hendrik Date: Wed, 23 Oct 2024 15:58:56 +0200 Subject: [PATCH] Do not separate chunks that are less then predefined context_line width apart --- src/data.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data.rs b/src/data.rs index 92a14a4..cd57dbb 100644 --- a/src/data.rs +++ b/src/data.rs @@ -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 {