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;
}