disabled pace caret jumping forward when stop on error is enabled

This commit is contained in:
Jack 2021-07-05 19:17:27 +01:00
parent c5607b5d9a
commit c5783c3f5d

View file

@ -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);