提交 ddbaab0f 编写于 作者: R rebornix

Re #96564

上级 b38ccc00
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { EditorInput, IEditorInput, GroupIdentifier, ISaveOptions, IMoveResult } from 'vs/workbench/common/editor';
import { EditorInput, IEditorInput, GroupIdentifier, ISaveOptions, IMoveResult, IRevertOptions } from 'vs/workbench/common/editor';
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
import { URI } from 'vs/base/common/uri';
import { isEqual, basename } from 'vs/base/common/resources';
......@@ -123,9 +123,9 @@ export class NotebookEditorInput extends EditorInput {
return { editor: editorInput };
}
async revert(group: GroupIdentifier): Promise<void> {
async revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
if (this.textModel) {
await this.textModel.revert();
await this.textModel.revert(options);
}
return;
......
......@@ -70,6 +70,11 @@ export class NotebookEditorModel extends EditorModel implements IWorkingCopy, IN
}
async revert(options?: IRevertOptions | undefined): Promise<void> {
if (options?.soft) {
await this.backupFileService.discardBackup(this.resource);
return;
}
await this.load({ forceReadFromDisk: true });
this._dirty = false;
this._onDidChangeDirty.fire();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册