File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/vs/workbench/electron-sandbox Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -319,10 +319,10 @@ export class NativeWindow extends Disposable {
319
319
return ; // do not indicate dirty of working copies that are auto saved after short delay
320
320
}
321
321
322
- this . updateDocumentEdited ( gotDirty ) ;
322
+ this . updateDocumentEdited ( gotDirty ? true : undefined ) ;
323
323
} ) ) ;
324
324
325
- this . updateDocumentEdited ( ) ;
325
+ this . updateDocumentEdited ( undefined ) ;
326
326
327
327
// Detect minimize / maximize
328
328
this . _register ( Event . any (
@@ -511,11 +511,18 @@ export class NativeWindow extends Disposable {
511
511
}
512
512
}
513
513
514
- private updateDocumentEdited ( isDirty = this . workingCopyService . hasDirty ) : void {
515
- if ( ( ! this . isDocumentedEdited && isDirty ) || ( this . isDocumentedEdited && ! isDirty ) ) {
516
- this . isDocumentedEdited = isDirty ;
514
+ private updateDocumentEdited ( documentEdited : true | undefined ) : void {
515
+ let setDocumentEdited : boolean ;
516
+ if ( typeof documentEdited === 'boolean' ) {
517
+ setDocumentEdited = documentEdited ;
518
+ } else {
519
+ setDocumentEdited = this . workingCopyService . hasDirty ;
520
+ }
521
+
522
+ if ( ( ! this . isDocumentedEdited && setDocumentEdited ) || ( this . isDocumentedEdited && ! setDocumentEdited ) ) {
523
+ this . isDocumentedEdited = setDocumentEdited ;
517
524
518
- this . nativeHostService . setDocumentEdited ( isDirty ) ;
525
+ this . nativeHostService . setDocumentEdited ( setDocumentEdited ) ;
519
526
}
520
527
}
521
528
You can’t perform that action at this time.
0 commit comments