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 {
319319 return ; // do not indicate dirty of working copies that are auto saved after short delay
320320 }
321321
322- this . updateDocumentEdited ( gotDirty ) ;
322+ this . updateDocumentEdited ( gotDirty ? true : undefined ) ;
323323 } ) ) ;
324324
325- this . updateDocumentEdited ( ) ;
325+ this . updateDocumentEdited ( undefined ) ;
326326
327327 // Detect minimize / maximize
328328 this . _register ( Event . any (
@@ -511,11 +511,18 @@ export class NativeWindow extends Disposable {
511511 }
512512 }
513513
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 ;
517524
518- this . nativeHostService . setDocumentEdited ( isDirty ) ;
525+ this . nativeHostService . setDocumentEdited ( setDocumentEdited ) ;
519526 }
520527 }
521528
You can’t perform that action at this time.
0 commit comments