Skip to content

Commit

Permalink
Fix za in deleted hunk
Browse files Browse the repository at this point in the history
Related #25835
  • Loading branch information
ConradIrwin committed Mar 3, 2025
1 parent 466be14 commit 6b141f4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12965,13 +12965,18 @@ impl Editor {
}
} else {
let multi_buffer_snapshot = self.buffer.read(cx).snapshot(cx);
let buffer_ids: HashSet<_> = multi_buffer_snapshot
.ranges_to_buffer_ranges(self.selections.disjoint_anchor_ranges())
.map(|(snapshot, _, _)| snapshot.remote_id())
let buffer_ids: HashSet<_> = self
.selections
.disjoint_anchor_ranges()
.flat_map(|range| multi_buffer_snapshot.buffer_ids_for_range(range))
.collect();

let should_unfold = buffer_ids
.iter()
.any(|buffer_id| self.is_buffer_folded(*buffer_id, cx));

for buffer_id in buffer_ids {
if self.is_buffer_folded(buffer_id, cx) {
if should_unfold {
self.unfold_buffer(buffer_id, cx);
} else {
self.fold_buffer(buffer_id, cx);
Expand Down

0 comments on commit 6b141f4

Please sign in to comment.