Skip to content

Commit

Permalink
Only fire is dirty event for custom editor when the editor model is a…
Browse files Browse the repository at this point in the history
…ctually dirty

Fixes #86551

Firing isDirty causes the editor to become pinned. We don't want this to happen by if no edits have happened
  • Loading branch information
mjbvz committed Dec 18, 2019
1 parent 5d9bcb2 commit 906b111
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export class CustomFileEditorInput extends LazilyResolvedWebviewEditorInput {
public async resolve(): Promise<IEditorModel> {
this._model = await this.customEditorService.models.loadOrCreate(this.getResource(), this.viewType);
this._register(this._model.onDidChangeDirty(() => this._onDidChangeDirty.fire()));
this._onDidChangeDirty.fire();
if (this.isDirty()) {
this._onDidChangeDirty.fire();
}
return await super.resolve();
}

Expand Down

0 comments on commit 906b111

Please sign in to comment.