Skip to content

Commit aab9968

Browse files
committed
Fix head movement bug while typing
1 parent 7b61761 commit aab9968

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ class App {
897897

898898
// fallthrough
899899
case "home":
900+
this.endTapeMove();
900901
this.head = 0;
901902

902903
if (action === "home") {
@@ -1209,7 +1210,9 @@ class App {
12091210
case "Delete":
12101211
this.headSymbol = this.spec.blank;
12111212
this.tapeRow.children.item(headCellIndex).firstChild.innerText = this.spec.blank;
1212-
this.move((ev.key === "Backspace") ? L : R);
1213+
1214+
if (ev.key === "Backspace")
1215+
this.move(L);
12131216
break;
12141217
case "ArrowLeft":
12151218
this.move(L);
@@ -1222,6 +1225,7 @@ class App {
12221225
if (this.head === 0)
12231226
return;
12241227

1228+
this.endTapeMove();
12251229
this.head = 0;
12261230
this.updateTape();
12271231
break;

0 commit comments

Comments
 (0)