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.

settings_ui: Use any open workspace window when opening settings links (#42106)

Ben Kunklefb87972f44a6
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs
index e3fb37b9026..be1c2464cc3 100644
--- a/crates/zed/src/main.rs
+++ b/crates/zed/src/main.rs
@@ -859,15 +859,19 @@ fn handle_open_request(request: OpenRequest, app_state: Arc<AppState>, cx: &mut
// zed://settings/languages/Rust/tab_size - SUPPORT
// languages.$(language).tab_size
// [ languages $(language) tab_size]
- workspace::with_active_or_new_workspace(cx, |_workspace, window, cx| {
- match setting_path {
+ cx.spawn(async move |cx| {
+ let workspace =
+ workspace::get_any_active_workspace(app_state, cx.clone()).await?;
+
+ workspace.update(cx, |_, window, cx| match setting_path {
None => window.dispatch_action(Box::new(zed_actions::OpenSettings), cx),
Some(setting_path) => window.dispatch_action(
Box::new(zed_actions::OpenSettingsAt { path: setting_path }),
cx,
),
- }
- });
+ })
+ })
+ .detach_and_log_err(cx);
}
}