Don't try creating markup previews of folded cells

Fixes #140515
This commit is contained in:
Matt Bierner 2022-02-11 16:39:24 -08:00
parent 2b752cc239
commit 6153117f9e
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -2540,6 +2540,17 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
return;
}
if (!this.viewModel) {
return;
}
const modelIndex = this.viewModel.getCellIndex(cell);
const foldedRanges = this.viewModel.getHiddenRanges();
const isVisible = !foldedRanges.some(range => modelIndex >= range.start && modelIndex < range.end);
if (!isVisible) {
return;
}
const cellTop = this._list.getAbsoluteTopOfElement(cell);
await this._webview.showMarkupPreview({
mime: cell.mime,