From 2461902086d8ee56c43ea7c5d013a220e602e6f4 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 7 Dec 2023 17:51:59 +0100 Subject: [PATCH] Don't panic when trying to reuse an existing workspace Co-Authored-By: Nathan --- crates/workspace2/src/workspace2.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index abf908992978ff8e870eb88efe72f7ce0e332c41..e2965bb8d7ace47c29039e09ba66838fb4f5c256 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -4188,14 +4188,14 @@ pub fn open_paths( }); cx.spawn(move |mut cx| async move { if let Some(existing) = existing { - // // Ok(( - // existing.clone(), - // cx.update_window_root(&existing, |workspace, cx| { - // workspace.open_paths(abs_paths, true, cx) - // })? - // .await, - // )) - todo!() + Ok(( + existing.clone(), + existing + .update(&mut cx, |workspace, cx| { + workspace.open_paths(abs_paths, true, cx) + })? + .await, + )) } else { cx.update(move |cx| { Workspace::new_local(abs_paths, app_state.clone(), requesting_window, cx)