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.

Update components.rs

Mikayla Makib7e03507c293
diff --git a/crates/theme/src/components.rs b/crates/theme/src/components.rs
index fce7ad825cc..8a0d8527a4d 100644
--- a/crates/theme/src/components.rs
+++ b/crates/theme/src/components.rs
@@ -175,8 +175,13 @@ pub mod action_button {
.on_click(MouseButton::Left, {
let action = self.action.boxed_clone();
move |_, _, cx| {
- cx.window()
- .dispatch_action(cx.view_id(), action.as_ref(), cx);
+ let window = cx.window();
+ let view = cx.view_id();
+ let action = action.boxed_clone();
+ cx.spawn(|_, mut cx| async move {
+ window.dispatch_action(view, action.as_ref(), &mut cx)
+ })
+ .detach();
}
})
.with_cursor_style(CursorStyle::PointingHand)