Skip to content

Commit

Permalink
better length check
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden committed May 16, 2024
1 parent aa58399 commit ebbcb1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/notebook/src/browser/view-model/notebook-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class NotebookModel implements Saveable, Disposable {

// if selected cell is affected update it because it can potentially have been replaced
if (cell === this.selectedCell) {
this.setSelectedCell(this.cells.length > cellIndex ? this.cells[cellIndex] : this.cells[this.cells.length - 1]);
this.setSelectedCell(this.cells[Math.min(cellIndex, this.cells.length - 1)]);
}
}

Expand Down

0 comments on commit ebbcb1b

Please sign in to comment.