diff --git a/src/js/input-controller.js b/src/js/input-controller.js index 6b1cba533..48da76069 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -165,7 +165,11 @@ function handleBackspace(event) { // TestLogic.input.appendCurrent(limiter); // } - if (/^[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]*$/g.test(TestLogic.input.getCurrent())) { + if ( + /^[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]*$/g.test( + TestLogic.input.getCurrent() + ) + ) { //pop current and previous TestLogic.input.resetCurrent(); TestLogic.input.popHistory(); @@ -181,7 +185,10 @@ function handleBackspace(event) { TestLogic.input.popHistory(); TestLogic.corrected.popHistory(); } else { - const regex = new RegExp(/[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]/, "g"); + const regex = new RegExp( + /[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]/, + "g" + ); let input = TestLogic.input.getCurrent(); @@ -289,7 +296,6 @@ function handleSpace(event, isEnter) { } else { //incorrect word MonkeyPower.addPower(false, true); - PaceCaret.handleSpace(false, currentWord); if (Config.funbox !== "nospace") { if (!Config.playSoundOnError || Config.blindMode) { Sound.playClick(Config.playSoundOnClick); @@ -326,6 +332,7 @@ function handleSpace(event, isEnter) { } return; } + PaceCaret.handleSpace(false, currentWord); if (Config.blindMode) $("#words .word.active letter").addClass("correct"); TestLogic.input.pushHistory(); TestUI.highlightBadWord(TestUI.currentWordElementIndex, !Config.blindMode);