"Focus Last Cell" should focus last visible cell

Fix #142250
This commit is contained in:
Rob Lourens
2022-02-04 21:24:05 -08:00
parent 44047c7637
commit 663771335a
4 changed files with 37 additions and 13 deletions

View File

@@ -562,6 +562,24 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
return index + 1;
}
getPreviousVisibleCellIndex(index: number) {
for (let i = this._hiddenRanges.length - 1; i >= 0; i--) {
const cellRange = this._hiddenRanges[i];
const foldStart = cellRange.start - 1;
const foldEnd = cellRange.end;
if (foldEnd < index) {
return index;
}
if (foldStart <= index) {
return foldStart;
}
}
return index + 1;
}
hasCell(cell: ICellViewModel) {
return this._handleToViewCellMapping.has(cell.handle);
}