提交 62e86cba 编写于 作者: B Benjamin Pasero

Fishy corner case with auto save on when save fails (fixes #16977)

上级 c7df27e5
......@@ -352,10 +352,19 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
return this.createTextEditorModel(fileContent, content.resource).then(() => {
this.createTextEditorModelPromise = null;
// We restored a backup so we have to set the model as being dirty
// We also want to trigger auto save if it is enabled to simulate the exact same behaviour
// you would get if manually making the model dirty (fixes https://github.com/Microsoft/vscode/issues/16977)
if (backupResource) {
this.makeDirty();
} else {
this.setDirty(false); // Ensure we are not tracking a stale state
if (this.autoSaveAfterMilliesEnabled) {
this.doAutoSave(this.versionId);
}
}
// Ensure we are not tracking a stale state
else {
this.setDirty(false);
}
this.toDispose.push(this.textEditorModel.onDidChangeRawContent((e: IModelContentChangedEvent) => this.onModelContentChanged(e)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册