Skip to content

Commit 9a1e635

Browse files
committed
fix: keymap next not working correctly
1 parent 37bb96c commit 9a1e635

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

frontend/src/ts/test/test-ui.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,11 @@ function afterAnyTestInput(
17401740
}
17411741

17421742
if (Config.keymapMode === "next") {
1743-
highlight(
1744-
TestWords.words.getCurrent()?.text.charAt(getCurrentInput().length) ?? "",
1745-
);
1743+
const keyToHighlight =
1744+
TestWords.words.getCurrent()?.textWithCommit[getCurrentInput().length];
1745+
if (keyToHighlight !== undefined) {
1746+
highlight(keyToHighlight);
1747+
}
17461748
}
17471749

17481750
Focus.set(true);
@@ -1828,6 +1830,15 @@ export async function afterTestWordChange(
18281830
if (lastBurst !== null && Numbers.isSafeNumber(lastBurst)) {
18291831
void LiveBurst.update(Math.round(lastBurst));
18301832
}
1833+
1834+
if (Config.keymapMode === "next") {
1835+
const keyToHighlight =
1836+
TestWords.words.getCurrent()?.textWithCommit[getCurrentInput().length];
1837+
if (keyToHighlight !== undefined) {
1838+
highlight(keyToHighlight);
1839+
}
1840+
}
1841+
18311842
if (direction === "forward") {
18321843
//
18331844
} else if (direction === "back") {

0 commit comments

Comments
 (0)