Make sure we dispose of one more disposable when rendering markdown

Fixes #131145
This commit is contained in:
Matt Bierner 2021-08-19 14:30:24 -07:00
parent da5fa2b50a
commit a64f66fe42
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -568,7 +568,7 @@ export class CellOutputContainer extends Disposable {
this.templateData.outputShowMoreContainer.innerText = '';
if (this.viewCell.outputsViewModels.length > this.options.limit) {
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement());
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement(this.templateData.disposables));
} else {
DOM.hide(this.templateData.outputShowMoreContainer);
this.viewCell.updateOutputShowMoreContainerHeight(0);
@ -773,7 +773,7 @@ export class CellOutputContainer extends Disposable {
if (this.viewCell.outputsViewModels.length > this.options.limit) {
DOM.show(this.templateData.outputShowMoreContainer);
if (!this.templateData.outputShowMoreContainer.hasChildNodes()) {
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement());
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement(this.templateData.disposables));
}
this.viewCell.updateOutputShowMoreContainerHeight(46);
} else {
@ -789,7 +789,7 @@ export class CellOutputContainer extends Disposable {
this._validateFinalOutputHeight(!outputHasDynamicHeight || this.viewCell.outputsViewModels.length === 0);
}
private _generateShowMoreElement(): any {
private _generateShowMoreElement(disposables: DisposableStore): HTMLElement {
const md: IMarkdownString = {
value: `There are more than ${this.options.limit} outputs, [show more (open the raw output data in a text editor) ...](command:workbench.action.openLargeOutput)`,
isTrusted: true,
@ -805,7 +805,7 @@ export class CellOutputContainer extends Disposable {
return;
},
disposables: new DisposableStore()
disposables
}
});