From 5a1a1722e0cdf0c6f6f81f6b8c17069269d1ebb0 Mon Sep 17 00:00:00 2001 From: Maurits van Riezen Date: Fri, 12 Apr 2024 11:05:42 +0200 Subject: [PATCH] fix number display in register and input boxes --- src/scripts/main.ts | 4 ++-- src/style/style.scss | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/main.ts b/src/scripts/main.ts index 08891dd..aaf272a 100644 --- a/src/scripts/main.ts +++ b/src/scripts/main.ts @@ -147,7 +147,7 @@ function update_ui_for_program(o: AnyTypeProgramState) { stack_div.innerText = o.stacks.map(i => i.contents.map(j => o.number_implementation.toString(j)).join(' ')).join('\n'); cursor_postion_box.textContent = JSON.stringify(o.cursor); - register_box.textContent = o.stacks.map(i => i.register).join(', '); + register_box.textContent = o.stacks.map(i => o.number_implementation.toString(i.register)).join(', '); } let program_state: AnyTypeProgramState = { @@ -195,7 +195,7 @@ function initializeProgramState( input_queue.reverse(); let val = input_queue.pop() ?? number_implementation.fromInt(-1); input_queue.reverse(); - input_queue_div.textContent = input_queue.join(' '); + input_queue_div.textContent = input_queue.map(number_implementation.toString).join(' '); return val; }, output: (o: T) => { diff --git a/src/style/style.scss b/src/style/style.scss index d2ca2ec..7848d32 100644 --- a/src/style/style.scss +++ b/src/style/style.scss @@ -36,7 +36,8 @@ body { } .two-columns>div { - flex-grow: 1; + min-width: 0; + min-height: 0; } .flex { @@ -137,6 +138,7 @@ button:hover:not(:disabled) { .program { white-space: pre; + overflow-x: auto; } .cursor {