From c1e950222340898117bac71981ab58f3eceb0fc6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 9 Sep 2020 16:51:31 +0200 Subject: [PATCH] Save prompt is shown while saving from settings split json editor (fix #106330) --- src/vs/workbench/contrib/files/browser/fileCommands.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts index cf8f51deedc..66a5bd24f00 100644 --- a/src/vs/workbench/contrib/files/browser/fileCommands.ts +++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts @@ -371,9 +371,14 @@ async function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEd // Special treatment for side by side editors: if the active editor // has 2 sides, we consider both, to support saving both sides. - // We only allow this when saving, not for "Save As". + // We only allow this when saving, not for "Save As" and not if any + // editor is untitled which would bring up a "Save As" dialog too. // See also https://github.com/microsoft/vscode/issues/4180 - if (activeGroup.activeEditor instanceof SideBySideEditorInput && !options?.saveAs) { + // See also https://github.com/microsoft/vscode/issues/106330 + if ( + activeGroup.activeEditor instanceof SideBySideEditorInput && + !options?.saveAs && !(activeGroup.activeEditor.primary.isUntitled() || activeGroup.activeEditor.secondary.isUntitled()) + ) { editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary }); editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary }); } else {