reworked stop on error

This commit is contained in:
Jack 2020-12-21 00:42:05 +00:00
parent 324d9bbc18
commit f26cbda596

View file

@ -1097,8 +1097,11 @@ function compareInput(showError) {
} else {
if (currentWord[i] == undefined) {
if (!config.hideExtraLetters) {
ret +=
'<letter class="incorrect extra">' + input[i] + "</letter>";
let letter = input[i];
if (letter == " ") {
letter = "_";
}
ret += `<letter class="incorrect extra">${letter}</letter>`;
}
} else {
ret +=
@ -4620,7 +4623,20 @@ $(document).keydown((event) => {
} else {
if (config.confidenceMode === "max") return;
if (event["ctrlKey"] || event["altKey"]) {
currentInput = "";
let split = currentInput.split(" ");
if (split[split.length - 1] == "") {
split.pop();
}
let addspace = false;
if (split.length > 1) {
addspace = true;
}
split.pop();
currentInput = split.join(" ");
if (addspace) {
currentInput += " ";
}
} else {
currentInput = currentInput.substring(0, currentInput.length - 1);
}
@ -4725,6 +4741,11 @@ $(document).keydown((event) => {
restartCount++;
return;
}
if (config.stopOnError == "word") {
currentInput += " ";
compareInput(true);
updateCaretPosition();
}
return;
}
inputHistory.push(currentInput);