This commit is contained in:
rebornix 2021-12-20 21:11:40 -08:00
parent e8a26d3ebf
commit 3a73bf805c
No known key found for this signature in database
GPG key ID: 181FC90D15393C20
2 changed files with 11 additions and 5 deletions

View file

@ -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);
}
}
}
}

View file

@ -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;