Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Use `Workspace::view` to construct the view
Marshall Bowers6e5ad75c5cfa
diff --git a/crates/ui2/src/components/workspace.rs b/crates/ui2/src/components/workspace.rsindex 807ce215aef..6faaa164d75 100644--- a/crates/ui2/src/components/workspace.rs+++ b/crates/ui2/src/components/workspace.rs@@ -23,10 +23,6 @@ pub struct Workspace {bottom_panel_scroll_state: ScrollState,}-fn workspace(cx: &mut WindowContext) -> View<Workspace> {- view(cx.entity(|cx| Workspace::new()), Workspace::render)-}-impl Workspace {pub fn new() -> Self {Self {@@ -109,6 +105,10 @@ impl Workspace {cx.notify();}+ pub fn view(cx: &mut WindowContext) -> View<Self> {+ view(cx.entity(|cx| Self::new()), Self::render)+ }+pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {let theme = theme(cx).clone();@@ -285,7 +285,7 @@ mod stories {pub fn view(cx: &mut WindowContext) -> View<Self> {view(cx.entity(|cx| Self {- workspace: workspace(cx),+ workspace: Workspace::view(cx),}),|view, cx| view.workspace.clone(),)