tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
properly do strikethrough shortcut on multi blocks
awarm.space
5 months ago
9878449e
10cc39c0
+7
-4
2 changed files
expand all
collapse all
unified
split
components
SelectionManager.tsx
src
shortcuts.ts
+2
-3
components/SelectionManager.tsx
···
214
214
},
215
215
},
216
216
{
217
217
-
metaKey: true,
218
218
-
shift: true,
219
219
-
key: "X",
217
217
+
metaAndCtrl: true,
218
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
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
18
-
if (!!shortcut.metaKey !== (isMac() ? e.metaKey : e.ctrlKey)) continue;
19
19
+
if (shortcut.metaAndCtrl) {
20
20
+
if (!(e.metaKey && e.ctrlKey)) continue;
21
21
+
} else if (!!shortcut.metaKey !== (isMac() ? e.metaKey : e.ctrlKey))
22
22
+
continue;
19
23
if (![shortcut.key].flat().includes(e.key)) continue;
20
24
e.preventDefault();
21
25
return shortcut.handler();