mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
parent
d6a3cd08ea
commit
8beddebbd4
1 changed files with 14 additions and 9 deletions
|
@ -768,15 +768,20 @@ function handleChar(
|
|||
const doesCurrentWordHaveTab = /^\t+/.test(TestWords.words.getCurrent());
|
||||
const isCurrentCharTab = currentWord[TestInput.input.current.length] === "\t";
|
||||
|
||||
if (
|
||||
thisCharCorrect &&
|
||||
Config.language.startsWith("code") &&
|
||||
doesCurrentWordHaveTab &&
|
||||
isCurrentCharTab
|
||||
) {
|
||||
const tabEvent = new KeyboardEvent("keydown", { key: "Tab", code: "Tab" });
|
||||
document.dispatchEvent(tabEvent);
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (
|
||||
thisCharCorrect &&
|
||||
Config.language.startsWith("code") &&
|
||||
doesCurrentWordHaveTab &&
|
||||
isCurrentCharTab
|
||||
) {
|
||||
const tabEvent = new KeyboardEvent("keydown", {
|
||||
key: "Tab",
|
||||
code: "Tab",
|
||||
});
|
||||
document.dispatchEvent(tabEvent);
|
||||
}
|
||||
}, 0);
|
||||
|
||||
if (char !== "\n") {
|
||||
void Caret.updatePosition();
|
||||
|
|
Loading…
Reference in a new issue