From d079201a6e27c91e983eaa7d8ac630d4aed79554 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 20 Dec 2021 15:44:51 -0800 Subject: [PATCH] Fix repeated calls to print() clearing output --- docs/_includes/repl.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/_includes/repl.html b/docs/_includes/repl.html index 5f60926..fa9993a 100644 --- a/docs/_includes/repl.html +++ b/docs/_includes/repl.html @@ -64,11 +64,7 @@ var lastError = undefined; function output(text) { - var output_clear = document.getElementById("output-clear"); var output_box = document.getElementById("output"); - if (output_clear.checked) { - output_box.value = ''; - } output_box.value += text.replace('stdin:', '') + "\n"; // scroll to bottom output_box.scrollTop = output_box.scrollHeight; @@ -84,6 +80,12 @@ lastError = undefined; } + var output_clear = document.getElementById("output-clear"); + if (output_clear.checked) { + var output_box = document.getElementById("output"); + output_box.value = ''; + } + var err = Module.ccall('executeScript', 'string', ['string'], [editor.getValue()]); if (err) { var err_text = err.replace('stdin:', '');