From b6ca7d6b75a8b082c5a860fb81dbe621a5140b61 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Fri, 24 Apr 2026 21:08:50 +0200 Subject: [PATCH] fix(hp48): render edited stack lines while editing Use the input value for the first line and shift stack lookups down for subsequent lines during edit mode. Also route Enter through execute() so editing state is handled consistently before re-rendering. --- samples/hp48/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/hp48/index.html b/samples/hp48/index.html index 6a5d1f4..ca49400 100644 --- a/samples/hp48/index.html +++ b/samples/hp48/index.html @@ -287,8 +287,11 @@ } function getLineValue(line) { - if (line === 0 && calc.isEditing) { - return calc.inputValue; + if (calc.isEditing) { + if (line === 0) { + return calc.inputValue; + } + return calc.stack[line - 1]; } return calc.stack[line]; } @@ -383,10 +386,7 @@ try { if (event.key === 'Enter') { event.preventDefault(); - if (calc.isEditing) { - calc.command('enter'); - } - render(); + execute('enter'); return; }