mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-25 16:28:04 +08:00
added automatic tabs to code quotes only if the previous enter was typed correctly
closes #4266
This commit is contained in:
parent
06075eef5d
commit
2a36a33ee5
1 changed files with 20 additions and 0 deletions
|
|
@ -295,6 +295,16 @@ function handleSpace(): void {
|
|||
}
|
||||
} //end of line wrap
|
||||
|
||||
// enable if i decide that auto tab should also work after a space
|
||||
// if (
|
||||
// Config.language.startsWith("code") &&
|
||||
// /^\t+/.test(TestWords.words.getCurrent()) &&
|
||||
// TestWords.words.getCurrent()[TestInput.input.current.length] === "\t"
|
||||
// ) {
|
||||
// //send a tab event using jquery
|
||||
// $("#wordsInput").trigger($.Event("keydown", { key: "Tab", code: "Tab" }));
|
||||
// }
|
||||
|
||||
if (Config.keymapMode === "react") {
|
||||
KeymapEvent.flash(" ", true);
|
||||
}
|
||||
|
|
@ -652,6 +662,16 @@ function handleChar(
|
|||
handleSpace();
|
||||
}
|
||||
|
||||
if (
|
||||
thisCharCorrect &&
|
||||
Config.language.startsWith("code") &&
|
||||
/^\t+/.test(TestWords.words.getCurrent()) &&
|
||||
TestWords.words.getCurrent()[TestInput.input.current.length] === "\t"
|
||||
) {
|
||||
// handleChar("\t", TestInput.input.current.length);
|
||||
$("#wordsInput").trigger($.Event("keydown", { key: "Tab", code: "Tab" }));
|
||||
}
|
||||
|
||||
if (char !== "\n") {
|
||||
Caret.updatePosition();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue