From 09c37027ce076393946e84888fae47e6de7ed20a Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:27:07 -0400 Subject: [PATCH] Revert "Changed cmd+w with no open tabs to close window (#10740)" (cherry-pick #10986) (#10988) Cherry-picked Revert "Changed cmd+w with no open tabs to close window (#10740)" (#10986) This PR reverts #10740, as it makes it too easy to close Zed accidentally. Quitting Zed when you don't mean to is disruptive and can break your flow. This is even more the case when you're collaborating. Therefore, we shouldn't make it easy to quit Zed when you don't mean to. If we want to bring back this behavior it needs to have a corresponding setting that should, in my opinion, be **off** by default. Additionally, someone made the good point that this behavior should not be present on Linux or Windows. This reverts commit 5102e37a5bc344cb1f5f2a4116b55d4d3afafbb0. Release Notes: - Changed `cmd-w` with no open tabs to no longer close the window (preview-only). Co-authored-by: Marshall Bowers --- crates/workspace/src/pane.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index ddc81a3e12153e95554a8e73e318aa047a2f88c5..c9027f2c9083a1970b5373261f7af4ae3b44dcd5 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -5,7 +5,7 @@ use crate::{ }, toolbar::Toolbar, workspace_settings::{AutosaveSetting, TabBarSettings, WorkspaceSettings}, - CloseWindow, NewCenterTerminal, NewFile, NewSearch, OpenInTerminal, OpenTerminal, OpenVisible, + NewCenterTerminal, NewFile, NewSearch, OpenInTerminal, OpenTerminal, OpenVisible, SplitDirection, ToggleZoom, Workspace, }; use anyhow::Result; @@ -879,8 +879,6 @@ impl Pane { cx: &mut ViewContext, ) -> Option>> { if self.items.is_empty() { - // Close the window when there's no active items to close. - cx.dispatch_action(Box::new(CloseWindow)); return None; } let active_item_id = self.items[self.active_item_index].item_id();