mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
@@ -172,9 +172,17 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
|
||||
const outputElement = (prev.firstChild as HTMLElement | null);
|
||||
if (outputElement && outputElement.getAttribute('output-mime-type') === outputInfo.mime) {
|
||||
// same stream
|
||||
const text = outputInfo.text();
|
||||
|
||||
const element = document.createElement('span');
|
||||
// find child with same id
|
||||
const existing = outputElement.querySelector(`[output-item-id="${outputInfo.id}"]`) as HTMLElement | null;
|
||||
if (existing) {
|
||||
clearContainer(existing);
|
||||
}
|
||||
|
||||
const text = outputInfo.text();
|
||||
const element = existing ?? document.createElement('span');
|
||||
element.classList.add('output-stream');
|
||||
element.setAttribute('output-item-id', outputInfo.id);
|
||||
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, element);
|
||||
outputElement.appendChild(element);
|
||||
return;
|
||||
@@ -183,6 +191,7 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
|
||||
|
||||
const element = document.createElement('span');
|
||||
element.classList.add('output-stream');
|
||||
element.setAttribute('output-item-id', outputInfo.id);
|
||||
|
||||
const text = outputInfo.text();
|
||||
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, element);
|
||||
|
||||
Reference in New Issue
Block a user