From 88b1879aa28930d018b60a36ebf8ba551a2ae10d Mon Sep 17 00:00:00 2001 From: rebornix Date: Mon, 6 Jul 2020 11:58:44 -0700 Subject: [PATCH] fix #101681. avoid out of date splice2 triggered by hidden range update. --- .../contrib/notebook/browser/view/notebookCellList.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts b/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts index 3dc707837f8..1bc13d11af5 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts @@ -356,6 +356,10 @@ export class NotebookCellList extends WorkbenchList implements ID splice2(start: number, deleteCount: number, elements: CellViewModel[] = []): void { // we need to convert start and delete count based on hidden ranges + if (start < 0 || start > this.view.length) { + return; + } + super.splice(start, deleteCount, elements); const selectionsLeft = []; -- GitLab