Changed cmd+w with no open tabs to close window (#10740)
Fixes https://github.com/zed-industries/zed/issues/5322 Release Notes: - Changed cmd+w with no open tabs to close window [#5322](https://github.com/zed-industries/zed/issues/5322) https://github.com/zed-industries/zed/assets/22855292/113b1635-ae30-4718-a3d3-758a4bf53714
This commit is contained in:
parent
fee2065b64
commit
5102e37a5b
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue