From 69c2da0dd4e35642ec4fde1038774b7da4beb4c3 Mon Sep 17 00:00:00 2001 From: rebornix Date: Wed, 1 Jul 2020 14:38:33 -0700 Subject: [PATCH] avoid revert if it is not dirty --- .../workbench/contrib/notebook/browser/notebookEditorInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts index 382fce7d995..8dfb595f64c 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts @@ -133,7 +133,7 @@ export class NotebookEditorInput extends EditorInput { } async revert(group: GroupIdentifier, options?: IRevertOptions): Promise { - if (this._textModel) { + if (this._textModel && this._textModel.object.isDirty()) { await this._textModel.object.revert(options); }