mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-28 23:58:23 +01:00
@@ -213,10 +213,10 @@ export class NotebookStickyScroll extends Disposable {
|
||||
}
|
||||
|
||||
// if we are here, the cell is a code cell.
|
||||
// check next cell, if markdown, that means this is the end of the section
|
||||
const nextCell = this.notebookEditor.cellAt(i + 1);
|
||||
if (nextCell) {
|
||||
if (nextCell.cellKind === CellKind.Markup) {
|
||||
// check next visible cell, if markdown, that means this is the end of the section
|
||||
const nextVisibleCell = this.notebookEditor.cellAt(i + 1);
|
||||
if (nextVisibleCell && i + 1 < visibleRange.end) {
|
||||
if (nextVisibleCell.cellKind === CellKind.Markup) {
|
||||
// this is the end of the section
|
||||
// store the bottom scroll position of this cell
|
||||
sectionBottom = this.notebookCellList.getCellViewScrollBottom(cell);
|
||||
@@ -299,9 +299,9 @@ export class NotebookStickyScroll extends Disposable {
|
||||
|
||||
// if we are here, the cell is a code cell.
|
||||
// check next cell, if markdown, that means this is the end of the section
|
||||
const nextCell = this.notebookEditor.cellAt(i + 1);
|
||||
if (nextCell) {
|
||||
if (nextCell.cellKind === CellKind.Markup) {
|
||||
const nextVisibleCell = this.notebookEditor.cellAt(i + 1);
|
||||
if (nextVisibleCell && i + 1 < visibleRange.end) {
|
||||
if (nextVisibleCell.cellKind === CellKind.Markup) {
|
||||
// this is the end of the section
|
||||
// store the bottom scroll position of this cell
|
||||
sectionBottom = this.notebookCellList.getCellViewScrollBottom(cell);
|
||||
@@ -376,8 +376,8 @@ export class NotebookStickyScroll extends Disposable {
|
||||
}
|
||||
|
||||
private updateDisplay() {
|
||||
const hasChildren = this.domNode.hasChildNodes();
|
||||
if (!hasChildren) {
|
||||
const hasSticky = this.currentStickyLines.size > 0;
|
||||
if (!hasSticky) {
|
||||
this.domNode.style.display = 'none';
|
||||
} else {
|
||||
this.domNode.style.display = 'block';
|
||||
@@ -400,6 +400,11 @@ export class NotebookStickyScroll extends Disposable {
|
||||
|
||||
const elementsToRender = [];
|
||||
while (currentEntry) {
|
||||
if (currentEntry.level === 7) {
|
||||
// level 7 represents a comment in python, which we don't want to render
|
||||
currentEntry = currentEntry.parent;
|
||||
continue;
|
||||
}
|
||||
const lineToRender = this.createStickyElement(currentEntry, partial);
|
||||
newMap.set(currentEntry, lineToRender);
|
||||
elementsToRender.unshift(lineToRender);
|
||||
|
||||
Reference in New Issue
Block a user