Skip to content

Commit

Permalink
re #139541.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Dec 21, 2021
1 parent e8a26d3 commit 3a73bf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ class NotebookCellPausing extends Disposable implements IWorkbenchContribution {
internalMetadata.didPause = true;
}

notebookModel?.applyEdits([{
editType: CellEditType.PartialInternalMetadata,
handle: parsed.handle,
internalMetadata,
}], true, undefined, () => undefined, undefined);
if (notebookModel?.checkCellExistence(parsed.handle)) {
notebookModel?.applyEdits([{
editType: CellEditType.PartialInternalMetadata,
handle: parsed.handle,
internalMetadata,
}], true, undefined, () => undefined, undefined);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
return this.cells.findIndex(c => !!c.outputs.find(o => o.outputId === outputId));
}

checkCellExistence(handle: number) {
return this._cellListeners.has(handle);
}

reset(cells: ICellDto2[], metadata: NotebookDocumentMetadata, transientOptions: TransientOptions): void {
this.transientOptions = transientOptions;
this._cellhandlePool = 0;
Expand Down

0 comments on commit 3a73bf8

Please sign in to comment.