@@ -17,13 +17,15 @@ import { localize } from 'vs/nls';
17
17
import { ConfirmResult , IDialogOptions , IDialogService } from 'vs/platform/dialogs/common/dialogs' ;
18
18
import { IEditorModel } from 'vs/platform/editor/common/editor' ;
19
19
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
20
+ import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
20
21
import { IRevertOptions , SaveSourceRegistry } from 'vs/workbench/common/editor' ;
21
22
import { EditorModel } from 'vs/workbench/common/editor/editorModel' ;
22
23
import { MergeEditorInputData } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput' ;
23
24
import { conflictMarkers } from 'vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController' ;
24
25
import { MergeDiffComputer } from 'vs/workbench/contrib/mergeEditor/browser/model/diffComputer' ;
25
26
import { InputData , MergeEditorModel } from 'vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel' ;
26
27
import { MergeEditorTelemetry } from 'vs/workbench/contrib/mergeEditor/browser/telemetry' ;
28
+ import { StorageCloseWithConflicts } from 'vs/workbench/contrib/mergeEditor/common/mergeEditor' ;
27
29
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
28
30
import { ITextFileEditorModel , ITextFileSaveOptions , ITextFileService } from 'vs/workbench/services/textfile/common/textfiles' ;
29
31
@@ -349,6 +351,7 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor
349
351
private readonly resultTextFileModel : ITextFileEditorModel ,
350
352
private readonly telemetry : MergeEditorTelemetry ,
351
353
@IDialogService private readonly _dialogService : IDialogService ,
354
+ @IStorageService private readonly _storageService : IStorageService ,
352
355
) {
353
356
super ( ) ;
354
357
}
@@ -449,7 +452,7 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor
449
452
const { choice } = await this . _dialogService . show ( Severity . Info , message , actions . map ( a => a [ 0 ] ) , { ...options , cancelId : actions . length - 1 } ) ;
450
453
return actions [ choice ] [ 1 ] ;
451
454
452
- } else if ( someUnhandledConflicts ) {
455
+ } else if ( someUnhandledConflicts && ! this . _storageService . getBoolean ( StorageCloseWithConflicts , StorageScope . PROFILE , false ) ) {
453
456
const message = isMany
454
457
? localize ( 'workspace.messageN.nonDirty' , 'Do you want to close {0} merge editors?' , inputModels . length )
455
458
: localize ( 'workspace.message1.nonDirty' , 'Do you want to close the merge editor for {0}?' , basename ( inputModels [ 0 ] . resultUri ) ) ;
@@ -471,7 +474,16 @@ class WorkspaceMergeEditorInputModel extends EditorModel implements IMergeEditor
471
474
[ localize ( 'workspace.cancel' , 'Cancel' ) , ConfirmResult . CANCEL ] ,
472
475
] ;
473
476
474
- const { choice } = await this . _dialogService . show ( Severity . Info , message , actions . map ( a => a [ 0 ] ) , { ...options , cancelId : actions . length - 1 } ) ;
477
+ const { choice, checkboxChecked } = await this . _dialogService . show ( Severity . Info , message , actions . map ( a => a [ 0 ] ) , {
478
+ ...options ,
479
+ cancelId : actions . length - 1 ,
480
+ checkbox : { label : localize ( 'noMoreWarn' , "Don't ask again" ) }
481
+ } ) ;
482
+
483
+ if ( checkboxChecked ) {
484
+ this . _storageService . store ( StorageCloseWithConflicts , true , StorageScope . PROFILE , StorageTarget . USER ) ;
485
+ }
486
+
475
487
return actions [ choice ] [ 1 ] ;
476
488
} else {
477
489
// This shouldn't do anything
0 commit comments