From 17afd49adbb02773040f81f9cd95635c60116108 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 09:49:54 -0500 Subject: [PATCH] settings_ui: Use any open workspace window when opening settings links (#42106) (cherry-pick to preview) (#42196) Cherry-pick of #42106 to preview ---- Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored-by: Ben Kunkle --- crates/zed/src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 18903d888090bbc1fa0955d46417486a3f9fe13b..75a5e952bb4b252b3161c9761f5289adb0b96f72 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, 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); } }