File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 32
32
"@codemirror/state" : " ^6.4.1" ,
33
33
"@codemirror/view" : " ^6.34.1" ,
34
34
"@parcel/transformer-typescript-tsc" : " ^2.12.0" ,
35
- "@types/node" : " ^22.7.5 " ,
35
+ "@types/node" : " ^22.7.6 " ,
36
36
"@types/react" : " ^18.3.11" ,
37
37
"@types/react-dom" : " ^18.3.1" ,
38
38
"@uiw/codemirror-theme-github" : " ^4.23.5" ,
Original file line number Diff line number Diff line change 1
- import { defaultKeymap , history , historyKeymap } from '@codemirror/commands' ;
1
+ import {
2
+ defaultKeymap ,
3
+ history ,
4
+ historyKeymap ,
5
+ indentMore ,
6
+ } from '@codemirror/commands' ;
2
7
import { markdown } from '@codemirror/lang-markdown' ;
3
8
import {
4
9
defaultHighlightStyle ,
@@ -34,6 +39,14 @@ const Editor = auto((props: { store: Store }) => {
34
39
}
35
40
} ,
36
41
) ;
42
+
43
+ // Define the custom key binding
44
+ const customKeymap = keymap . of ( [
45
+ {
46
+ key : 'Tab' ,
47
+ run : indentMore ,
48
+ } ,
49
+ ] ) ;
37
50
const cm = new EditorView ( {
38
51
extensions : [
39
52
store . editorTheme . of ( githubLight ) ,
@@ -52,6 +65,7 @@ const Editor = auto((props: { store: Store }) => {
52
65
keymap . of ( [ ...defaultKeymap , ...historyKeymap ] ) ,
53
66
markdown ( ) ,
54
67
syntaxHighlighting ( defaultHighlightStyle ) ,
68
+ customKeymap ,
55
69
contentChangeListener ,
56
70
] ,
57
71
parent : editorDiv . current ! ,
Original file line number Diff line number Diff line change 1612
1612
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
1613
1613
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
1614
1614
1615
- " @types/node@^22.7.5 " :
1616
- version "22.7.5 "
1617
- resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5 .tgz#cfde981727a7ab3611a481510b473ae54442b92b "
1618
- integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ ==
1615
+ " @types/node@^22.7.6 " :
1616
+ version "22.7.6 "
1617
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.6 .tgz#3ec3e2b071e136cd11093c19128405e1d1f92f33 "
1618
+ integrity sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw ==
1619
1619
dependencies :
1620
1620
undici-types "~6.19.2"
1621
1621
@@ -4010,11 +4010,16 @@ prop-types@^15.8.1:
4010
4010
object-assign "^4.1.1"
4011
4011
react-is "^16.13.1"
4012
4012
4013
- punycode@^2.1.0, punycode@^2.3.1 :
4013
+ punycode@^2.1.0 :
4014
4014
version "2.3.1"
4015
4015
resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
4016
4016
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
4017
4017
4018
+ punycode@^2.3.1 :
4019
+ version "2.3.1"
4020
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
4021
+ integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
4022
+
4018
4023
queue-microtask@^1.2.2 :
4019
4024
version "1.2.3"
4020
4025
resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
You can’t perform that action at this time.
0 commit comments