Skip to content

Commit 74865b3

Browse files
committed
On mark a custom editor non-dirty if save is successful
1 parent 9b89cca commit 74865b3

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/vs/workbench/contrib/customEditor/common/customEditorModel.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,19 @@ export class CustomEditorModel extends Disposable implements ICustomEditorModel
6060
this._onDidChangeDirty.fire();
6161
}
6262

63-
public async save(options?: ISaveOptions): Promise<boolean> {
64-
this._savePoint = this._currentEditIndex;
65-
this.updateDirty();
66-
63+
public async save(_options?: ISaveOptions): Promise<boolean> {
6764
const untils: Promise<any>[] = [];
6865
const handler = { waitUntil: (until: Promise<any>) => untils.push(until) };
69-
this._onWillSave.fire(handler);
70-
await Promise.all(untils);
66+
67+
try {
68+
this._onWillSave.fire(handler);
69+
await Promise.all(untils);
70+
} catch {
71+
return false;
72+
}
73+
74+
this._savePoint = this._currentEditIndex;
75+
this.updateDirty();
7176

7277
return true;
7378
}

0 commit comments

Comments
 (0)