all repos — hex @ 4ba4789d8a81829292c728028bbadf31e8b75a1f

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Fixed character detection in playground.
h3rald h3rald@h3rald.com
Mon, 02 Dec 2024 05:41:21 +0000
commit

4ba4789d8a81829292c728028bbadf31e8b75a1f

parent

c070ca5e13090819004773fae89119eceb0aa6d4

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M web/assets/hex-playground.jsweb/assets/hex-playground.js

@@ -8,6 +8,10 @@ Module.print = (text) => {

document.querySelector("article section").textContent += text + '\n'; }; +Module.printErr = (text) => { + document.querySelector("article section").textContent += text + '\n'; +}; + const inputBox = document.querySelector("article input"); inputBox.addEventListener("keydown", (e) => {

@@ -16,7 +20,7 @@ e.preventDefault();

Module.pending_lines.push(Module.pending_chars.join('')); Module.pending_chars = []; inputBox.value = ''; - } else { + } else if (e.key.length === 1) { Module.pending_chars.push(e.key); } if (Module.pending_fgets.length > 0 && Module.pending_lines.length > 0) {