66import * as nls from 'vs/nls' ;
77import { Action } from 'vs/base/common/actions' ;
88import { mixin } from 'vs/base/common/objects' ;
9- import { IEditorInput , EditorInput , IEditorIdentifier , IEditorCommandsContext , CloseDirection , SaveReason , EditorsOrder } from 'vs/workbench/common/editor' ;
9+ import { IEditorInput , EditorInput , IEditorIdentifier , IEditorCommandsContext , CloseDirection , SaveReason , EditorsOrder , SideBySideEditorInput } from 'vs/workbench/common/editor' ;
1010import { QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel' ;
1111import { EditorQuickOpenEntry , EditorQuickOpenEntryGroup , IEditorQuickOpenEntry , QuickOpenAction } from 'vs/workbench/browser/quickopen' ;
1212import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen' ;
@@ -23,7 +23,7 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
2323import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces' ;
2424import { IFileDialogService , ConfirmResult } from 'vs/platform/dialogs/common/dialogs' ;
2525import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService' ;
26- import { ResourceMap , values } from 'vs/base/common/map' ;
26+ import { values } from 'vs/base/common/map' ;
2727
2828export class ExecuteCommandAction extends Action {
2929
@@ -640,23 +640,24 @@ export abstract class BaseCloseAllAction extends Action {
640640 return undefined ;
641641 } ) ) ;
642642
643- const dirtyEditorsToConfirmByName = new Set < string > ( ) ;
644- const dirtyEditorsToConfirmByResource = new ResourceMap ( ) ;
643+ const dirtyEditorsToConfirm = new Set < string > ( ) ;
645644
646645 for ( const editor of this . editorService . editors ) {
647646 if ( ! editor . isDirty ( ) || editor . isSaving ( ) ) {
648647 continue ; // only interested in dirty editors (unless in the process of saving)
649648 }
650649
651- const resource = editor . getResource ( ) ;
652- if ( resource ) {
653- dirtyEditorsToConfirmByResource . set ( resource , true ) ;
650+ let name : string ;
651+ if ( editor instanceof SideBySideEditorInput ) {
652+ name = editor . master . getName ( ) ; // prefer shorter names by using master's name in this case
654653 } else {
655- dirtyEditorsToConfirmByName . add ( editor . getName ( ) ) ;
654+ name = editor . getName ( ) ;
656655 }
656+
657+ dirtyEditorsToConfirm . add ( name ) ;
657658 }
658659
659- const confirm = await this . fileDialogService . showSaveConfirm ( [ ... dirtyEditorsToConfirmByResource . keys ( ) , ... values ( dirtyEditorsToConfirmByName ) ] ) ;
660+ const confirm = await this . fileDialogService . showSaveConfirm ( values ( dirtyEditorsToConfirm ) ) ;
660661 if ( confirm === ConfirmResult . CANCEL ) {
661662 return ;
662663 }
0 commit comments