aboutsummaryrefslogtreecommitdiff
path: root/src_frontend/Components/Editor/Output.svelte
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2022-04-28 20:06:38 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2022-04-28 20:08:55 +0200
commit916ab40d65c9c25f63256f2cd98be297c3da2208 (patch)
treedcf07544310fd34f79e72f34ef0e653f30a163f0 /src_frontend/Components/Editor/Output.svelte
parent4ee57ab935718a269fe7ab65b26ff27837d49003 (diff)
downloadLuxcena-Neo-916ab40d65c9c25f63256f2cd98be297c3da2208.tar.gz
Luxcena-Neo-916ab40d65c9c25f63256f2cd98be297c3da2208.zip
:bug: Small bugfixes
Diffstat (limited to 'src_frontend/Components/Editor/Output.svelte')
-rw-r--r--src_frontend/Components/Editor/Output.svelte9
1 files changed, 8 insertions, 1 deletions
diff --git a/src_frontend/Components/Editor/Output.svelte b/src_frontend/Components/Editor/Output.svelte
index 9e4c953..52b7216 100644
--- a/src_frontend/Components/Editor/Output.svelte
+++ b/src_frontend/Components/Editor/Output.svelte
@@ -4,6 +4,7 @@
let scrollBox;
let htmlCode = "";
+ let buffer = "";
function addData(data, classname) {
// let styles = "white-space:pre-wrap;margin:0;";
@@ -17,11 +18,17 @@
styles += "color: red";
break;
}
- htmlCode += `<span style="${styles}">${data}</span>`;
+ buffer += `<span style="${styles}">${data}</span>`;
if (scrollBox != null) {
scrollBox.scrollTop = scrollBox.scrollHeight + 100;
}
}
+
+ function flushBuffer() {
+ htmlCode += buffer;
+ buffer = "";
+ };
+ setInterval(flushBuffer, 400);
authorizedSocket.on("editor:proc:start", () => htmlCode = "");
authorizedSocket.on("editor:proc:exit", (code) => addData(`\nMode exited with ${code}\n\n`, "exit"));