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.
This commit is contained in:
matmoul committed 2026-04-24 21:08:50 +02:00
1 parent 236df5db14
commit b6ca7d6b75
1 file changed
+5 -5
+5 -5
View File
@@ -287,9 +287,12 @@
} }
function getLineValue(line) { function getLineValue(line) {
if (line === 0 && calc.isEditing) { if (calc.isEditing) {
if (line === 0) {
return calc.inputValue; return calc.inputValue;
} }
return calc.stack[line - 1];
}
return calc.stack[line]; return calc.stack[line];
} }
@@ -383,10 +386,7 @@
try { try {
if (event.key === 'Enter') { if (event.key === 'Enter') {
event.preventDefault(); event.preventDefault();
if (calc.isEditing) { execute('enter');
calc.command('enter');
}
render();
return; return;
} }