Close secondary workspace windows after the last tab

This commit is contained in:
Knotty Wyvern
2026-10-21 15:06:55 -07:00
parent b742d274f1
commit f741389418
4 changed files with 75 additions and 6 deletions
+6 -1
View File
@@ -504,8 +504,13 @@
for (const target of targets) {
if (documents !== current || switching) break;
const tab = "buffer" in target ? current?.buffers.find(item => item.id === target.buffer.id) : undefined;
if ("buffer" in target && (!tab || (scope !== "one" && tab.pinned))) continue;
if (desktop && getCurrentWindow().label.startsWith("workspace-") && workingTabs.length === 1) {
await getCurrentWindow().close();
break;
}
if ("buffer" in target) {
if (!tab || (scope !== "one" && tab.pinned)) continue;
if (!tab) continue;
const contents = tab.contents;
if (contents !== tab.saved && !await confirm($t("Discard unsaved edits in {name}?", { name: tab.name }), { title: $t("Close document"), kind: "warning" })) break;
if (documents !== current || switching || tab.contents !== contents) break;