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.

added workspace event for WorkspaceCreated

KCaverlyb148c610479f
diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs
index bb9cb7e527e..48f4ae21cd1 100644
--- a/crates/workspace2/src/workspace2.rs
+++ b/crates/workspace2/src/workspace2.rs
@@ -544,6 +544,7 @@ impl DelayedDebouncedEditAction {
pub enum Event {
PaneAdded(View<Pane>),
ContactRequestedJoin(u64),
+ WorkspaceCreated(WeakView<Workspace>),
}
pub struct Workspace {
@@ -697,8 +698,7 @@ impl Workspace {
Ok(())
});
- // todo!("replace with a different mechanism")
- // cx.emit_global(WorkspaceCreated(weak_handle.clone()));
+ cx.emit(Event::WorkspaceCreated(weak_handle.clone()));
let left_dock = cx.build_view(|_| Dock::new(DockPosition::Left));
let bottom_dock = cx.build_view(|_| Dock::new(DockPosition::Bottom));
@@ -4250,7 +4250,7 @@ impl ViewId {
// }
// }
-// pub struct WorkspaceCreated(pub WeakView<Workspace>);
+pub struct WorkspaceCreated(pub WeakView<Workspace>);
pub fn activate_workspace_for_project(
cx: &mut AppContext,