This commit is contained in:
rebornix 2021-03-24 16:17:37 -07:00
parent 1d3cbad010
commit f0eacf8770
No known key found for this signature in database
GPG key ID: 181FC90D15393C20

View file

@ -693,6 +693,9 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
super.setSelection(indexes, browserEvent);
}
/**
* The range will be revealed with as little scrolling as possible.
*/
revealElementsInView(range: ICellRange) {
const startIndex = this._getViewIndexUpperBound2(range.start);
@ -713,6 +716,11 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
const endElementTop = this.view.elementTop(endIndex);
const endElementHeight = this.view.elementHeight(endIndex);
if (endElementTop + endElementHeight <= wrapperBottom) {
// fully visible
return;
}
if (endElementTop >= wrapperBottom) {
return this._revealInternal(endIndex, false, CellRevealPosition.Bottom);
}