From 2f734cbd5e24526479bfbe4e411dfe097afae9da Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Fri, 14 Feb 2025 01:07:07 -0500 Subject: [PATCH] Fix missing hunks in project diff (#24847) Release Notes: - N/A --- crates/editor/src/editor.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index b2ab8fc1098202..96b9e645ea6957 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -12502,10 +12502,7 @@ impl Editor { snapshot: &MultiBufferSnapshot, ) -> bool { let mut hunks = self.diff_hunks_in_ranges(ranges, &snapshot); - hunks.any(|hunk| { - log::debug!("considering {hunk:?}"); - hunk.secondary_status == DiffHunkSecondaryStatus::HasSecondaryHunk - }) + hunks.any(|hunk| hunk.secondary_status == DiffHunkSecondaryStatus::HasSecondaryHunk) } pub fn toggle_staged_selected_diff_hunks( @@ -14160,15 +14157,13 @@ impl Editor { let buffer_id = buffer.read(cx).remote_id(); if self.buffer.read(cx).diff_for(buffer_id).is_none() { if let Some(project) = &self.project { - self.load_diff_task = Some( - get_uncommitted_diff_for_buffer( - project, - [buffer.clone()], - self.buffer.clone(), - cx, - ) - .shared(), - ); + get_uncommitted_diff_for_buffer( + project, + [buffer.clone()], + self.buffer.clone(), + cx, + ) + .detach(); } } cx.emit(EditorEvent::ExcerptsAdded {