Skip to content

Commit 6d7de18

Browse files
authored
Dirty window indicator goes away when changing a setting (fix microsoft#165798) (microsoft#165892)
1 parent 96db0b3 commit 6d7de18

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/vs/workbench/electron-sandbox/window.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)