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:
parent
0ec29d6866
commit
559ce87b4e
4 changed files with 36 additions and 14 deletions
|
@ -32,7 +32,8 @@ use ui::{
|
|||
};
|
||||
use util::{paths::PathExt, ResultExt};
|
||||
use workspace::{
|
||||
AppState, ModalView, SerializedWorkspaceLocation, Workspace, WorkspaceId, WORKSPACE_DB,
|
||||
AppState, CloseIntent, ModalView, SerializedWorkspaceLocation, Workspace, WorkspaceId,
|
||||
WORKSPACE_DB,
|
||||
};
|
||||
|
||||
#[derive(PartialEq, Clone, Deserialize, Default)]
|
||||
|
@ -311,7 +312,7 @@ impl PickerDelegate for RecentProjectsDelegate {
|
|||
cx.spawn(move |workspace, mut cx| async move {
|
||||
let continue_replacing = workspace
|
||||
.update(&mut cx, |workspace, cx| {
|
||||
workspace.prepare_to_close(true, cx)
|
||||
workspace.prepare_to_close(CloseIntent::ReplaceWindow, cx)
|
||||
})?
|
||||
.await?;
|
||||
if continue_replacing {
|
||||
|
@ -570,7 +571,7 @@ fn open_dev_server_project(
|
|||
cx.spawn(move |workspace, mut cx| async move {
|
||||
let continue_replacing = workspace
|
||||
.update(&mut cx, |workspace, cx| {
|
||||
workspace.prepare_to_close(true, cx)
|
||||
workspace.prepare_to_close(CloseIntent::ReplaceWindow, cx)
|
||||
})?
|
||||
.await?;
|
||||
if continue_replacing {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue