Skip to content

Commit

Permalink
Fix missing hunks in project diff (zed-industries#24847)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A
  • Loading branch information
cole-miller authored Feb 14, 2025
1 parent 5ac8216 commit 2f734cb
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2f734cb

Please sign in to comment.