Fix test failure and improve visibility check (#210128)

* Fix test failure when UI is small

* oops
This commit is contained in:
Don Jayamanne
2024-04-11 16:07:50 +10:00
committed by GitHub
parent 804f8e3929
commit f309a5e375

View File

@@ -127,6 +127,9 @@ async function addCellAndRun(code: string, notebook: vscode.NotebookDocument) {
});
function lastCellIsVisible(notebookEditor: vscode.NotebookEditor) {
if (!notebookEditor.visibleRanges.length) {
return false;
}
const lastVisibleCell = notebookEditor.visibleRanges[notebookEditor.visibleRanges.length - 1].end;
return notebookEditor.notebook.cellCount === lastVisibleCell;
}