Skip to content

Commit ea22cfb

Browse files
committed
check the model for modified property
1 parent bd471a2 commit ea22cfb

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export class InteractiveEditorInput extends EditorInput implements ICompositeNot
220220
}
221221

222222
override isModified() {
223-
return true;
223+
return this._editorModelReference?.isModified() ?? false;
224224
}
225225

226226
override dispose() {

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ export interface INotebookEditorModel extends IEditorModel {
797797
readonly notebook: INotebookTextModel | undefined;
798798
isResolved(): this is IResolvedNotebookEditorModel;
799799
isDirty(): boolean;
800+
isModified(): boolean;
800801
isReadonly(): boolean | IMarkdownString;
801802
isOrphaned(): boolean;
802803
hasAssociatedFilePath(): boolean;

src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ export class SimpleNotebookEditorModel extends EditorModel implements INotebookE
8585
return this._workingCopy?.isDirty() ?? false;
8686
}
8787

88+
isModified(): boolean {
89+
return this._workingCopy?.isModified() ?? false;
90+
}
91+
8892
isOrphaned(): boolean {
8993
return SimpleNotebookEditorModel._isStoredFileWorkingCopy(this._workingCopy) && this._workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN);
9094
}

src/vs/workbench/contrib/notebook/test/browser/testNotebookEditor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ export class NotebookEditorTestModel extends EditorModel implements INotebookEdi
134134
return this._dirty;
135135
}
136136

137+
isModified(): boolean {
138+
return this._dirty;
139+
}
140+
137141
getNotebook(): NotebookTextModel {
138142
return this._notebook;
139143
}

0 commit comments

Comments
 (0)