From c8fbc0d3486854232892e84b8c332f3125416cc3 Mon Sep 17 00:00:00 2001 From: Julia Date: Fri, 28 Oct 2022 19:05:29 -0400 Subject: [PATCH] Slightly expand region hunk layout checks for folds --- crates/editor/src/git.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/git.rs b/crates/editor/src/git.rs index 28db27c6abe60572b0d0d4d738fc2ab32f6c0d23..6f7958039985330a0aae2fea15c45e9b939fed43 100644 --- a/crates/editor/src/git.rs +++ b/crates/editor/src/git.rs @@ -63,8 +63,8 @@ pub fn diff_hunk_to_display(hunk: DiffHunk, snapshot: &DisplaySnapshot) -> let is_removal = hunk.status() == DiffHunkStatus::Removed; - let folds_start = Point::new(hunk.buffer_range.start.saturating_sub(1), 0); - let folds_end = Point::new(hunk.buffer_range.end + 1, 0); + let folds_start = Point::new(hunk.buffer_range.start.saturating_sub(2), 0); + let folds_end = Point::new(hunk.buffer_range.end + 2, 0); let folds_range = folds_start..folds_end; let containing_fold = snapshot.folds_in_range(folds_range).find(|fold_range| {