linux: Save opened workspace when closing last window (#15754)

Fixes https://github.com/zed-industries/zed/issues/15642
(also fixes a bug where replacing a workspace in the same window would
reopen the old project after closing with `CTRL + Q`)

Release Notes:

- Linux: Fixed last workspace not being restored on startup
([#15642](https://github.com/zed-industries/zed/issues/15642)).
- Fixed a bug where a closed workspace could be reopened on startup.
This commit is contained in:
apricotbucket28 2024-08-05 04:54:02 -03:00 committed by GitHub
parent 0ec29d6866
commit 559ce87b4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 36 additions and 14 deletions

View file

@ -43,7 +43,7 @@ use std::{
},
};
use text::Point;
use workspace::Workspace;
use workspace::{CloseIntent, Workspace};
#[gpui::test(iterations = 10)]
async fn test_host_disconnect(
@ -134,7 +134,9 @@ async fn test_host_disconnect(
// Ensure client B is not prompted to save edits when closing window after disconnecting.
let can_close = workspace_b
.update(cx_b, |workspace, cx| workspace.prepare_to_close(true, cx))
.update(cx_b, |workspace, cx| {
workspace.prepare_to_close(CloseIntent::Quit, cx)
})
.unwrap()
.await
.unwrap();