Skip to content

Commit

Permalink
[Bug][Comparison View] Saving the file in the active editor will caus…
Browse files Browse the repository at this point in the history
…e both files to be saved. (fix #190210) (#190944)
  • Loading branch information
bpasero authored Aug 22, 2023
1 parent 763fdc0 commit c3e9263
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vs/workbench/contrib/files/browser/fileCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,16 @@ async function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEd
// has 2 sides, we consider both, to support saving both sides.
// 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.
// In addition, we require the secondary side to be modified to not
// trigger a touch operation unexpectedly.
//
// See also https://github.com/microsoft/vscode/issues/4180
// See also https://github.com/microsoft/vscode/issues/106330
// See also https://github.com/microsoft/vscode/issues/190210
if (
activeGroup.activeEditor instanceof SideBySideEditorInput &&
!options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(EditorInputCapabilities.Untitled) || activeGroup.activeEditor.secondary.hasCapability(EditorInputCapabilities.Untitled))
!options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(EditorInputCapabilities.Untitled) || activeGroup.activeEditor.secondary.hasCapability(EditorInputCapabilities.Untitled)) &&
activeGroup.activeEditor.secondary.isModified()
) {
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary });
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary });
Expand Down

0 comments on commit c3e9263

Please sign in to comment.