Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Nov 16, 2023
1 parent 301581c commit c1d906d
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 241 deletions.
4 changes: 2 additions & 2 deletions src/core-atoms/latex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export class LatexAtom extends Atom {
classes: this.isSuggestion
? 'ML__suggestion'
: this.isError
? 'ML__error'
: '',
? 'ML__error'
: '',
type: 'latex',
maxFontSize: 1.0,
});
Expand Down
4 changes: 2 additions & 2 deletions src/editor-mathfield/keyboard-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ function insertMathModeChar(
mathfield.adoptStyle === 'left'
? atom
: atom.parent
? atom.rightSibling
: null;
? atom.rightSibling
: null;
if (
sibling?.type === 'mord' &&
/[a-zA-Z0-9]/.test(sibling.value) &&
Expand Down
3 changes: 1 addition & 2 deletions src/editor/keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,8 @@ function normalizeKeybinding(
// Convert it to a key code.
const code = getCodeForKey(modifiers.key, layout);
// if (!code) throw new Error('Invalid keybinding key "' + keybinding.key + '"');
if (!code) {
if (!code)
return { ...keybinding, key: keystrokeModifiersToString(modifiers) };
}

if ((code.shift && modifiers.shift) || (code.alt && modifiers.alt)) {
throw new Error(
Expand Down
282 changes: 141 additions & 141 deletions src/editor/keyboard-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,147 +293,147 @@ export const DEFAULT_KEYBOARD_LAYOUT: KeyboardLayout =
},
}
: platform() === 'windows'
? {
id: 'windows.en-intl',
displayName: 'English (international)',
platform: 'windows',
virtualLayout: 'qwerty',
locale: 'en',
score: 0,
mapping: {
KeyA: ['a', 'A', 'á', 'Á'],
KeyB: ['b', 'B', '', ''],
KeyC: ['c', 'C', '©', '¢'],
KeyD: ['d', 'D', 'ð', 'Ð'],
KeyE: ['e', 'E', 'é', 'É'],
KeyF: ['f', 'F', '', ''],
KeyG: ['g', 'G', '', ''],
KeyH: ['h', 'H', '', ''],
KeyI: ['i', 'I', 'í', 'Í'],
KeyJ: ['j', 'J', '', ''],
KeyK: ['k', 'K', '', ''],
KeyL: ['l', 'L', 'ø', 'Ø'],
KeyM: ['m', 'M', 'µ', ''],
KeyN: ['n', 'N', 'ñ', 'Ñ'],
KeyO: ['o', 'O', 'ó', 'Ó'],
KeyP: ['p', 'P', 'ö', 'Ö'],
KeyQ: ['q', 'Q', 'ä', 'Ä'],
KeyR: ['r', 'R', '®', ''],
KeyS: ['s', 'S', 'ß', '§'],
KeyT: ['t', 'T', 'þ', 'Þ'],
KeyU: ['u', 'U', 'ú', 'Ú'],
KeyV: ['v', 'V', '', ''],
KeyW: ['w', 'W', 'å', 'Å'],
KeyX: ['x', 'X', '', ''],
KeyY: ['y', 'Y', 'ü', 'Ü'],
KeyZ: ['z', 'Z', 'æ', 'Æ'],
Digit1: ['1', '!', '¡', '¹'],
Digit2: ['2', '@', '²', ''],
Digit3: ['3', '#', '³', ''],
Digit4: ['4', '$', '¤', '£'],
Digit5: ['5', '%', '€', ''],
Digit6: ['6', '^', '¼', ''],
Digit7: ['7', '&', '½', ''],
Digit8: ['8', '*', '¾', ''],
Digit9: ['9', '(', '‘', ''],
Digit0: ['0', ')', '’', ''],
Space: [' ', ' ', '', ''],
Minus: ['-', '_', '¥', ''],
Equal: ['=', '+', '×', '÷'],
BracketLeft: ['[', '{', '«', ''],
BracketRight: [']', '}', '»', ''],
Backslash: ['\\', '|', '¬', '¦'],
Semicolon: [';', ':', '¶', '°'],
Quote: ["'", '"', '´', '¨'],
Backquote: ['`', '~', '', ''],
Comma: [',', '<', 'ç', 'Ç'],
Period: ['.', '>', '', ''],
Slash: ['/', '?', '¿', ''],
NumpadDivide: ['/', '/', '', ''],
NumpadMultiply: ['*', '*', '', ''],
NumpadSubtract: ['-', '-', '', ''],
NumpadAdd: ['+', '+', '', ''],
IntlBackslash: ['\\', '|', '', ''],
},
}
: {
id: 'linux.en',
displayName: 'English',
platform: 'linux',
virtualLayout: 'qwerty',
locale: 'en',
score: 0,
mapping: {
KeyA: ['a', 'A', 'a', 'A'],
KeyB: ['b', 'B', 'b', 'B'],
KeyC: ['c', 'C', 'c', 'C'],
KeyD: ['d', 'D', 'd', 'D'],
KeyE: ['e', 'E', 'e', 'E'],
KeyF: ['f', 'F', 'f', 'F'],
KeyG: ['g', 'G', 'g', 'G'],
KeyH: ['h', 'H', 'h', 'H'],
KeyI: ['i', 'I', 'i', 'I'],
KeyJ: ['j', 'J', 'j', 'J'],
KeyK: ['k', 'K', 'k', 'K'],
KeyL: ['l', 'L', 'l', 'L'],
KeyM: ['m', 'M', 'm', 'M'],
KeyN: ['n', 'N', 'n', 'N'],
KeyO: ['o', 'O', 'o', 'O'],
KeyP: ['p', 'P', 'p', 'P'],
KeyQ: ['q', 'Q', 'q', 'Q'],
KeyR: ['r', 'R', 'r', 'R'],
KeyS: ['s', 'S', 's', 'S'],
KeyT: ['t', 'T', 't', 'T'],
KeyU: ['u', 'U', 'u', 'U'],
KeyV: ['v', 'V', 'v', 'V'],
KeyW: ['w', 'W', 'w', 'W'],
KeyX: ['x', 'X', 'x', 'X'],
KeyY: ['y', 'Y', 'y', 'Y'],
KeyZ: ['z', 'Z', 'z', 'Z'],
Digit1: ['1', '!', '1', '!'],
Digit2: ['2', '@', '2', '@'],
Digit3: ['3', '#', '3', '#'],
Digit4: ['4', '$', '4', '$'],
Digit5: ['5', '%', '5', '%'],
Digit6: ['6', '^', '6', '^'],
Digit7: ['7', '&', '7', '&'],
Digit8: ['8', '*', '8', '*'],
Digit9: ['9', '(', '9', '('],
Digit0: ['0', ')', '0', ')'],
Space: [' ', ' ', ' ', ' '],
Minus: ['-', '_', '-', '_'],
Equal: ['=', '+', '=', '+'],
BracketLeft: ['[', '{', '[', '{'],
BracketRight: [']', '}', ']', '}'],
Backslash: ['\\', '|', '\\', '|'],
Semicolon: [';', ':', ';', ':'],
Quote: ["'", '"', "'", '"'],
Backquote: ['`', '~', '`', '~'],
Comma: [',', '<', ',', '<'],
Period: ['.', '>', '.', '>'],
Slash: ['/', '?', '/', '?'],
NumpadDivide: ['/', '/', '/', '/'],
NumpadMultiply: ['*', '*', '*', '*'],
NumpadSubtract: ['-', '-', '-', '-'],
NumpadAdd: ['+', '+', '+', '+'],
Numpad1: ['1', '1', '1', '1'],
Numpad2: ['2', '2', '2', '2'],
Numpad3: ['3', '3', '3', '3'],
Numpad4: ['4', '4', '4', '4'],
Numpad5: ['5', '5', '5', '5'],
Numpad6: ['6', '6', '6', '6'],
Numpad7: ['7', '7', '7', '7'],
Numpad8: ['8', '8', '8', '8'],
Numpad9: ['9', '9', '9', '9'],
Numpad0: ['0', '0', '0', '0'],
NumpadDecimal: ['', '.', '', '.'],
IntlBackslash: ['<', '>', '|', '¦'],
NumpadEqual: ['=', '=', '=', '='],
NumpadComma: ['.', '.', '.', '.'],
NumpadParenLeft: ['(', '(', '(', '('],
NumpadParenRight: [')', ')', ')', ')'],
},
};
? {
id: 'windows.en-intl',
displayName: 'English (international)',
platform: 'windows',
virtualLayout: 'qwerty',
locale: 'en',
score: 0,
mapping: {
KeyA: ['a', 'A', 'á', 'Á'],
KeyB: ['b', 'B', '', ''],
KeyC: ['c', 'C', '©', '¢'],
KeyD: ['d', 'D', 'ð', 'Ð'],
KeyE: ['e', 'E', 'é', 'É'],
KeyF: ['f', 'F', '', ''],
KeyG: ['g', 'G', '', ''],
KeyH: ['h', 'H', '', ''],
KeyI: ['i', 'I', 'í', 'Í'],
KeyJ: ['j', 'J', '', ''],
KeyK: ['k', 'K', '', ''],
KeyL: ['l', 'L', 'ø', 'Ø'],
KeyM: ['m', 'M', 'µ', ''],
KeyN: ['n', 'N', 'ñ', 'Ñ'],
KeyO: ['o', 'O', 'ó', 'Ó'],
KeyP: ['p', 'P', 'ö', 'Ö'],
KeyQ: ['q', 'Q', 'ä', 'Ä'],
KeyR: ['r', 'R', '®', ''],
KeyS: ['s', 'S', 'ß', '§'],
KeyT: ['t', 'T', 'þ', 'Þ'],
KeyU: ['u', 'U', 'ú', 'Ú'],
KeyV: ['v', 'V', '', ''],
KeyW: ['w', 'W', 'å', 'Å'],
KeyX: ['x', 'X', '', ''],
KeyY: ['y', 'Y', 'ü', 'Ü'],
KeyZ: ['z', 'Z', 'æ', 'Æ'],
Digit1: ['1', '!', '¡', '¹'],
Digit2: ['2', '@', '²', ''],
Digit3: ['3', '#', '³', ''],
Digit4: ['4', '$', '¤', '£'],
Digit5: ['5', '%', '€', ''],
Digit6: ['6', '^', '¼', ''],
Digit7: ['7', '&', '½', ''],
Digit8: ['8', '*', '¾', ''],
Digit9: ['9', '(', '‘', ''],
Digit0: ['0', ')', '’', ''],
Space: [' ', ' ', '', ''],
Minus: ['-', '_', '¥', ''],
Equal: ['=', '+', '×', '÷'],
BracketLeft: ['[', '{', '«', ''],
BracketRight: [']', '}', '»', ''],
Backslash: ['\\', '|', '¬', '¦'],
Semicolon: [';', ':', '¶', '°'],
Quote: ["'", '"', '´', '¨'],
Backquote: ['`', '~', '', ''],
Comma: [',', '<', 'ç', 'Ç'],
Period: ['.', '>', '', ''],
Slash: ['/', '?', '¿', ''],
NumpadDivide: ['/', '/', '', ''],
NumpadMultiply: ['*', '*', '', ''],
NumpadSubtract: ['-', '-', '', ''],
NumpadAdd: ['+', '+', '', ''],
IntlBackslash: ['\\', '|', '', ''],
},
}
: {
id: 'linux.en',
displayName: 'English',
platform: 'linux',
virtualLayout: 'qwerty',
locale: 'en',
score: 0,
mapping: {
KeyA: ['a', 'A', 'a', 'A'],
KeyB: ['b', 'B', 'b', 'B'],
KeyC: ['c', 'C', 'c', 'C'],
KeyD: ['d', 'D', 'd', 'D'],
KeyE: ['e', 'E', 'e', 'E'],
KeyF: ['f', 'F', 'f', 'F'],
KeyG: ['g', 'G', 'g', 'G'],
KeyH: ['h', 'H', 'h', 'H'],
KeyI: ['i', 'I', 'i', 'I'],
KeyJ: ['j', 'J', 'j', 'J'],
KeyK: ['k', 'K', 'k', 'K'],
KeyL: ['l', 'L', 'l', 'L'],
KeyM: ['m', 'M', 'm', 'M'],
KeyN: ['n', 'N', 'n', 'N'],
KeyO: ['o', 'O', 'o', 'O'],
KeyP: ['p', 'P', 'p', 'P'],
KeyQ: ['q', 'Q', 'q', 'Q'],
KeyR: ['r', 'R', 'r', 'R'],
KeyS: ['s', 'S', 's', 'S'],
KeyT: ['t', 'T', 't', 'T'],
KeyU: ['u', 'U', 'u', 'U'],
KeyV: ['v', 'V', 'v', 'V'],
KeyW: ['w', 'W', 'w', 'W'],
KeyX: ['x', 'X', 'x', 'X'],
KeyY: ['y', 'Y', 'y', 'Y'],
KeyZ: ['z', 'Z', 'z', 'Z'],
Digit1: ['1', '!', '1', '!'],
Digit2: ['2', '@', '2', '@'],
Digit3: ['3', '#', '3', '#'],
Digit4: ['4', '$', '4', '$'],
Digit5: ['5', '%', '5', '%'],
Digit6: ['6', '^', '6', '^'],
Digit7: ['7', '&', '7', '&'],
Digit8: ['8', '*', '8', '*'],
Digit9: ['9', '(', '9', '('],
Digit0: ['0', ')', '0', ')'],
Space: [' ', ' ', ' ', ' '],
Minus: ['-', '_', '-', '_'],
Equal: ['=', '+', '=', '+'],
BracketLeft: ['[', '{', '[', '{'],
BracketRight: [']', '}', ']', '}'],
Backslash: ['\\', '|', '\\', '|'],
Semicolon: [';', ':', ';', ':'],
Quote: ["'", '"', "'", '"'],
Backquote: ['`', '~', '`', '~'],
Comma: [',', '<', ',', '<'],
Period: ['.', '>', '.', '>'],
Slash: ['/', '?', '/', '?'],
NumpadDivide: ['/', '/', '/', '/'],
NumpadMultiply: ['*', '*', '*', '*'],
NumpadSubtract: ['-', '-', '-', '-'],
NumpadAdd: ['+', '+', '+', '+'],
Numpad1: ['1', '1', '1', '1'],
Numpad2: ['2', '2', '2', '2'],
Numpad3: ['3', '3', '3', '3'],
Numpad4: ['4', '4', '4', '4'],
Numpad5: ['5', '5', '5', '5'],
Numpad6: ['6', '6', '6', '6'],
Numpad7: ['7', '7', '7', '7'],
Numpad8: ['8', '8', '8', '8'],
Numpad9: ['9', '9', '9', '9'],
Numpad0: ['0', '0', '0', '0'],
NumpadDecimal: ['', '.', '', '.'],
IntlBackslash: ['<', '>', '|', '¦'],
NumpadEqual: ['=', '=', '=', '='],
NumpadComma: ['.', '.', '.', '.'],
NumpadParenLeft: ['(', '(', '(', '('],
NumpadParenRight: [')', ')', ')', ')'],
},
};

/* prettier-ignore */
const BASE_LAYOUT_MAPPING = {
Expand Down
Loading

0 comments on commit c1d906d

Please sign in to comment.