mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
disabled pace caret jumping forward when stop on error is enabled
This commit is contained in:
parent
c5607b5d9a
commit
c5783c3f5d
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue