mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
append when stream outputs are concatenated
This commit is contained in:
parent
5b78562d6c
commit
e68a34f9bd
|
@ -282,12 +282,17 @@ function renderStream(outputInfo: OutputWithAppend, outputElement: HTMLElement,
|
|||
const previousOutputParent = getPreviousMatchingContentGroup(outputElement);
|
||||
// If the previous output item for the same cell was also a stream, append this output to the previous
|
||||
if (previousOutputParent) {
|
||||
const newContent = createContent(outputInfo, ctx, outputScrolling, error);
|
||||
const existingContent = previousOutputParent.querySelector(`[output-item-id="${outputInfo.id}"]`) as HTMLElement | null;
|
||||
if (existingContent) {
|
||||
existingContent.replaceWith(newContent);
|
||||
|
||||
if (appendedText && outputScrolling) {
|
||||
appendScrollableOutput(existingContent, outputInfo.id, appendedText, outputInfo.text(), false);
|
||||
}
|
||||
else {
|
||||
const newContent = createContent(outputInfo, ctx, outputScrolling, error);
|
||||
existingContent.replaceWith(newContent);
|
||||
}
|
||||
} else {
|
||||
const newContent = createContent(outputInfo, ctx, outputScrolling, error);
|
||||
previousOutputParent.appendChild(newContent);
|
||||
}
|
||||
previousOutputParent.classList.toggle('scrollbar-visible', previousOutputParent.scrollHeight > previousOutputParent.clientHeight);
|
||||
|
|
|
@ -128,7 +128,7 @@ export function appendScrollableOutput(element: HTMLElement, id: string, appende
|
|||
outputLengths[id] = Math.min(fullBuffer.length, softScrollableLineLimit);
|
||||
const newElement = scrollableArrayOfString(id, fullBuffer.slice(-1 * softScrollableLineLimit), trustHtml);
|
||||
newElement.setAttribute('output-item-id', id);
|
||||
element.replaceWith();
|
||||
element.replaceWith(newElement);
|
||||
}
|
||||
else {
|
||||
element.appendChild(handleANSIOutput(buffer.join('\n'), trustHtml));
|
||||
|
|
Loading…
Reference in a new issue