Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix active pane modifiers applying to parent pane axis if child pane is active (#25836)

Ben Kunkleec88a6886ffc
diff --git a/crates/workspace/src/pane_group.rs b/crates/workspace/src/pane_group.rs
index 0b2cc55e3bc..58ae40c5361 100644
--- a/crates/workspace/src/pane_group.rs
+++ b/crates/workspace/src/pane_group.rs
@@ -214,13 +214,6 @@ impl Member {
Member::Axis(PaneAxis::new(axis, members))
}
- fn contains(&self, needle: &Entity<Pane>) -> bool {
- match self {
- Member::Axis(axis) => axis.members.iter().any(|member| member.contains(needle)),
- Member::Pane(pane) => pane == needle,
- }
- }
-
fn first_pane(&self) -> Entity<Pane> {
match self {
Member::Axis(axis) => axis.members[0].first_pane(),
@@ -702,7 +695,7 @@ impl PaneAxis {
cx.entity().downgrade(),
)
.children(self.members.iter().enumerate().map(|(ix, member)| {
- if member.contains(active_pane) {
+ if matches!(member, Member::Pane(pane) if pane == active_pane) {
active_pane_ix = Some(ix);
}
member