a tool for shared writing and social publishing

properly do strikethrough shortcut on multi blocks

+7 -4
+2 -3
components/SelectionManager.tsx
··· 214 214 }, 215 215 }, 216 216 { 217 - metaKey: true, 218 - shift: true, 219 - key: "X", 217 + metaAndCtrl: true, 218 + key: "x", 220 219 handler: async () => { 221 220 let [sortedBlocks] = await getSortedSelectionBound(); 222 221 toggleMarkInBlocks(
+5 -1
src/shortcuts.ts
··· 5 5 6 6 type Shortcut = { 7 7 metaKey?: boolean; 8 + metaAndCtrl?: boolean; 8 9 altKey?: boolean; 9 10 shift?: boolean; 10 11 key: string | string[]; ··· 15 16 for (let shortcut of [shortcuts].flat()) { 16 17 if (e.shiftKey !== !!shortcut.shift) continue; 17 18 if (e.altKey !== !!shortcut.altKey) continue; 18 - if (!!shortcut.metaKey !== (isMac() ? e.metaKey : e.ctrlKey)) continue; 19 + if (shortcut.metaAndCtrl) { 20 + if (!(e.metaKey && e.ctrlKey)) continue; 21 + } else if (!!shortcut.metaKey !== (isMac() ? e.metaKey : e.ctrlKey)) 22 + continue; 19 23 if (![shortcut.key].flat().includes(e.key)) continue; 20 24 e.preventDefault(); 21 25 return shortcut.handler();