check the model for modified property

This commit is contained in:
aamunger
2023-06-21 10:51:56 -07:00
parent bd471a259a
commit ea22cfbad5
4 changed files with 10 additions and 1 deletions
@@ -220,7 +220,7 @@ export class InteractiveEditorInput extends EditorInput implements ICompositeNot
}
override isModified() {
return true;
return this._editorModelReference?.isModified() ?? false;
}
override dispose() {
@@ -797,6 +797,7 @@ export interface INotebookEditorModel extends IEditorModel {
readonly notebook: INotebookTextModel | undefined;
isResolved(): this is IResolvedNotebookEditorModel;
isDirty(): boolean;
isModified(): boolean;
isReadonly(): boolean | IMarkdownString;
isOrphaned(): boolean;
hasAssociatedFilePath(): boolean;
@@ -85,6 +85,10 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
return this._workingCopy?.isDirty() ?? false;
}
isModified(): boolean {
return this._workingCopy?.isModified() ?? false;
}
isOrphaned(): boolean {
return SimpleNotebookEditorModel._isStoredFileWorkingCopy(this._workingCopy) && this._workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN);
}
@@ -134,6 +134,10 @@ export class NotebookEditorTestModel extends EditorModel implements INotebookEdi
return this._dirty;
}
isModified(): boolean {
return this._dirty;
}
getNotebook(): NotebookTextModel {
return this._notebook;
}