Skip to content

Commit f3532c9

Browse files
committed
chore - use workingCopyService.isDirty instead notebook.isDirty
1 parent 7e0c1aa commit f3532c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,9 @@ class NotebookFileTracker implements IWorkbenchContribution {
564564
constructor(
565565
@INotebookService private readonly _notebookService: INotebookService,
566566
@IEditorService private readonly _editorService: IEditorService,
567-
@IWorkingCopyService workingCopyService: IWorkingCopyService,
567+
@IWorkingCopyService private readonly _workingCopyService: IWorkingCopyService,
568568
) {
569-
this._dirtyListener = Event.debounce(workingCopyService.onDidChangeDirty, () => { }, 100)(() => {
569+
this._dirtyListener = Event.debounce(_workingCopyService.onDidChangeDirty, () => { }, 100)(() => {
570570
const inputs = this._createMissingNotebookEditors();
571571
this._editorService.openEditors(inputs);
572572
});
@@ -580,7 +580,7 @@ class NotebookFileTracker implements IWorkbenchContribution {
580580
const result: IResourceEditorInput[] = [];
581581

582582
for (const notebook of this._notebookService.getNotebookTextModels()) {
583-
if (notebook.isDirty && !this._editorService.isOpen({ resource: notebook.uri })) {
583+
if (this._workingCopyService.isDirty(notebook.uri.with({ scheme: Schemas.vscodeNotebook })) && !this._editorService.isOpen({ resource: notebook.uri })) {
584584
result.push({
585585
resource: notebook.uri,
586586
options: { inactive: true, preserveFocus: true, pinned: true }

0 commit comments

Comments
 (0)