Bind CloseWindow and Open actions on workspace

Co-Authored-By: Max <max@zed.dev>
This commit is contained in:
Nathan Sobo 2023-12-01 16:17:48 -07:00
parent 6f7995c150
commit 0edd89a92f
2 changed files with 85 additions and 88 deletions

View file

@ -168,9 +168,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
cx.on_window_should_close(move |cx| {
handle
.update(cx, |workspace, cx| {
if let Some(task) = workspace.close(&Default::default(), cx) {
task.detach_and_log_err(cx);
}
workspace.close_window(&Default::default(), cx);
false
})
.unwrap_or(true)