Commit 4502a45 1 parent 1c3364c commit 4502a45 Copy full SHA for 4502a45
File tree 1 file changed +34
-3
lines changed
packages/react-code-editor/src
1 file changed +34
-3
lines changed Original file line number Diff line number Diff line change 1
- import { indentWithTab } from '@codemirror/commands' ;
1
+ import { closeBracketsKeymap } from '@codemirror/autocomplete' ;
2
+ import {
3
+ defaultKeymap ,
4
+ history ,
5
+ historyKeymap ,
6
+ indentWithTab ,
7
+ } from '@codemirror/commands' ;
2
8
import {
3
9
defaultHighlightStyle ,
4
10
syntaxHighlighting ,
11
+ foldGutter ,
12
+ indentOnInput ,
13
+ foldKeymap ,
5
14
} from '@codemirror/language' ;
6
15
import { EditorState , Extension } from '@codemirror/state' ;
7
- import { EditorView , keymap } from '@codemirror/view' ;
16
+ import {
17
+ EditorView ,
18
+ drawSelection ,
19
+ dropCursor ,
20
+ highlightActiveLine ,
21
+ highlightActiveLineGutter ,
22
+ keymap ,
23
+ lineNumbers ,
24
+ } from '@codemirror/view' ;
8
25
import { reka as rekaCodemirrorExtension } from '@rekajs/codemirror' ;
9
26
import { Parser } from '@rekajs/parser' ;
10
27
import { useReka } from '@rekajs/react' ;
@@ -170,7 +187,21 @@ export const CodeEditor = ({
170
187
state : EditorState . create ( {
171
188
doc : currentCodeStringRef . current ,
172
189
extensions : [
173
- keymap . of ( [ indentWithTab ] ) ,
190
+ lineNumbers ( ) ,
191
+ foldGutter ( ) ,
192
+ indentOnInput ( ) ,
193
+ highlightActiveLine ( ) ,
194
+ highlightActiveLineGutter ( ) ,
195
+ history ( ) ,
196
+ drawSelection ( ) ,
197
+ dropCursor ( ) ,
198
+ keymap . of ( [
199
+ ...closeBracketsKeymap ,
200
+ ...defaultKeymap ,
201
+ ...historyKeymap ,
202
+ ...foldKeymap ,
203
+ indentWithTab ,
204
+ ] ) ,
174
205
rekaCodemirrorExtension ( ) ,
175
206
syntaxHighlighting ( defaultHighlightStyle , {
176
207
fallback : true ,
You can’t perform that action at this time.
0 commit comments