Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Changed cmd+w with no open tabs to close window (#10740)
William Viktorsson5102e37a5bc3
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex bf32f7c0c24..58b1d10aa0a 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},- NewCenterTerminal, NewFile, NewSearch, OpenInTerminal, OpenTerminal, OpenVisible,+ CloseWindow, NewCenterTerminal, NewFile, NewSearch, OpenInTerminal, OpenTerminal, OpenVisible,SplitDirection, ToggleZoom, Workspace,};use anyhow::Result;@@ -874,6 +874,8 @@ impl Pane {cx: &mut ViewContext<Self>,) -> Option<Task<Result<()>>> {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();