Satisfy formatter

This commit is contained in:
Henrik Giesel 2021-04-22 15:24:27 +02:00
parent f6ef4d43cb
commit 57357a42a5
2 changed files with 6 additions and 5 deletions

View File

@ -43,6 +43,7 @@ editing-unordered-list = Unordered list
editing-warning-cloze-deletions-will-not-work = Warning, cloze deletions will not work until you switch the type at the top to Cloze.
### deprecated, do not use
editing-bold-text-ctrlandb = Bold text (Ctrl+B)
editing-italic-text-ctrlandi = Italic text (Ctrl+I)
editing-underline-text-ctrlandu = Underline text (Ctrl+U)

View File

@ -53,7 +53,7 @@ function keyToPlatformString(key: string): string {
: key;
}
function toPlatformString(modifiersAndKey: string[]) {
function toPlatformString(modifiersAndKey: string[]): string {
return `${modifiersToPlatformString(
modifiersAndKey.slice(0, -1)
)}${keyToPlatformString(modifiersAndKey[modifiersAndKey.length - 1])}`;
@ -93,21 +93,21 @@ function innerShortcut(
callback: (event: KeyboardEvent) => void,
...keyCombination: string[][]
): void {
let interval: number;
if (keyCombination.length === 0) {
callback(lastEvent);
} else {
const [nextKey, ...restKeys] = keyCombination;
let ivl: number;
const handler = (event: KeyboardEvent): void => {
if (check(event, nextKey)) {
innerShortcut(event, callback, ...restKeys);
clearTimeout(ivl);
clearTimeout(interval);
}
};
ivl = setTimeout(
interval = setTimeout(
(): void => document.removeEventListener("keydown", handler),
shortcutTimeoutMs
);