提交 b1831abf 编写于 作者: M Matt Bierner

Fix folding of custom rendered markdown cells

Fixes #117262

Instead of looking at the folding state we should instead use `inputCollapsed`  property for folding
上级 b3a33306
......@@ -52,7 +52,6 @@ import { CodiconActionViewItem, createAndFillInActionBarActionsWithVerticalSepar
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
import { errorStateIcon, successStateIcon, unfoldIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
import { syncing } from 'vs/platform/theme/common/iconRegistry';
import { CellFoldingState } from 'vs/workbench/contrib/notebook/browser/contrib/fold/foldingModel';
const $ = DOM.$;
......@@ -540,8 +539,9 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
if (e.cellIsHoveredChanged) {
this.updateForHover(element, templateData);
}
if (e.foldingStateChanged) {
this.updateForFolding(element);
if (e.metadataChanged) {
this.updateCollapsedState(element);
}
}));
......@@ -579,8 +579,8 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
templateData.container.classList.toggle('markdown-cell-hover', element.cellIsHovered);
}
private updateForFolding(element: MarkdownCellViewModel) {
if (element.foldingState === CellFoldingState.Collapsed) {
private updateCollapsedState(element: MarkdownCellViewModel) {
if (element.metadata?.inputCollapsed) {
this.notebookEditor.hideMarkdownPreview(element);
} else {
this.notebookEditor.unhideMarkdownPreview(element);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册