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.

Restore previous workspace on application resume (#10813)

William Viktorsson95118c656868
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs
index 97b0526bbc2..de8c95dbf5b 100644
--- a/crates/zed/src/main.rs
+++ b/crates/zed/src/main.rs
@@ -227,8 +227,9 @@ fn init_ui(args: Args) {
app.on_reopen(move |cx| {
if let Some(app_state) = AppState::try_global(cx).and_then(|app_state| app_state.upgrade())
{
- workspace::open_new(app_state, cx, |workspace, cx| {
- Editor::new_file(workspace, &Default::default(), cx)
+ cx.spawn({
+ let app_state = app_state.clone();
+ |cx| async move { restore_or_create_workspace(app_state, cx).await }
})
.detach();
}