Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Nathan Sobo8ad736da8d39
diff --git a/crates/gpui/playground/src/playground.rs b/crates/gpui/playground/src/playground.rsindex bd184ac621d..88e953b8bc9 100644--- a/crates/gpui/playground/src/playground.rs+++ b/crates/gpui/playground/src/playground.rs@@ -55,17 +55,6 @@ fn playground<V: 'static>(theme: &ThemeColors) -> impl Element<V> {.h_full().w_full().fill(p.rose)- .block()- .child(- div()- .block()- .fill(p.pine)- .child(div().block().fill(p.love).w_6().h_3()),- )- .child(- div()- .block()- .fill(p.gold)- .child(div().block().fill(p.iris).w_3().h_3()),- )+ .child(div().fill(p.pine).child(div().fill(p.love).w_6().h_3()))+ .child(div().fill(p.gold).child(div().fill(p.iris).w_3().h_3()))}diff --git a/crates/gpui/src/app/window.rs b/crates/gpui/src/app/window.rsindex 62c514b4e95..a372b865fe0 100644--- a/crates/gpui/src/app/window.rs+++ b/crates/gpui/src/app/window.rs@@ -1276,9 +1276,12 @@ impl LayoutEngine {whereC: IntoIterator<Item = LayoutId>,{- Ok(self- .0- .new_with_children(style, &children.into_iter().collect::<Vec<_>>())?)+ let children = children.into_iter().collect::<Vec<_>>();+ if children.is_empty() {+ Ok(self.0.new_leaf(style)?)+ } else {+ Ok(self.0.new_with_children(style, &children)?)+ }}pub fn add_measured_node<F>(&mut self, style: LayoutStyle, measure: F) -> Result<LayoutId>@@ -1302,7 +1305,7 @@ impl LayoutEngine {}pub fn computed_layout(&mut self, node: LayoutId) -> Result<EngineLayout> {- dbg!(Ok(self.0.layout(node)?.into()))+ Ok(EngineLayout::from(self.0.layout(node)?))}}