提交 8397461b 编写于 作者: M Matt Bierner

Only mark custom editor as non-dirty once save has completed successfully

Fixes #101872
上级 88929c7a
......@@ -522,19 +522,22 @@ class MainThreadCustomEditorModel extends Disposable implements ICustomEditorMod
this._ongoingSave?.cancel();
this._ongoingSave = savePromise;
this.change(() => {
this._isDirtyFromContentChange = false;
this._savePoint = this._currentEditIndex;
this._fromBackup = false;
});
try {
await savePromise;
if (this._ongoingSave === savePromise) { // Make sure we are still doing the same save
this.change(() => {
this._isDirtyFromContentChange = false;
this._savePoint = this._currentEditIndex;
this._fromBackup = false;
});
}
} finally {
if (this._ongoingSave === savePromise) {
if (this._ongoingSave === savePromise) { // Make sure we are still doing the same save
this._ongoingSave = undefined;
}
}
return this._editorResource;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册