Skip to content

Commit eafe0c9

Browse files
committed
Define extra keys
1 parent 4b8b258 commit eafe0c9

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ Copyright © 2015 - 2024 [Tyler Liu](https://github.com/tylerlong/)
5353
- Close most GitHub issues
5454
- preview dark mode
5555
- Just copy its example: https://docs.github.com/en/get-started/writing-on-github
56-
- codemirror 6 issues:
57-
- editor.setOption('extraKeys', extraKeys);
5856
- Evaluate latest version of mermaid
5957
- Every useEffect should have a dispose method
6058
- Preview dark theme and light theme

src/components/editor.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ const Editor = auto((props: { store: Store }) => {
4646
key: 'Tab',
4747
run: indentMore,
4848
},
49+
{
50+
key: 'Mod-s',
51+
run: () => true,
52+
},
53+
{
54+
key: 'Mod-,',
55+
run: () => {
56+
(document.querySelector('i.fa-cog') as HTMLElement).click();
57+
return true;
58+
},
59+
},
60+
{
61+
key: 'Mod-b',
62+
run: () => {
63+
(document.querySelector('i.fa-bold') as HTMLElement).click();
64+
return true;
65+
},
66+
},
4967
]);
5068
const cm = new EditorView({
5169
extensions: [

0 commit comments

Comments
 (0)