Close secondary workspace windows after the last tab
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user