File tree 1 file changed +13
-2
lines changed
packages/@sanity/vision/src/codemirror
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 8
8
syntaxHighlighting ,
9
9
} from '@codemirror/language'
10
10
import { highlightSelectionMatches } from '@codemirror/search'
11
- import { Extension } from '@codemirror/state'
11
+ import { type Extension } from '@codemirror/state'
12
12
import {
13
13
drawSelection ,
14
14
highlightActiveLine ,
@@ -31,5 +31,16 @@ export const codemirrorExtensions: Extension[] = [
31
31
history ( ) ,
32
32
drawSelection ( ) ,
33
33
syntaxHighlighting ( defaultHighlightStyle , { fallback : true } ) ,
34
- keymap . of ( [ defaultKeymap , historyKeymap ] . flat ( ) . filter ( Boolean ) ) ,
34
+ keymap . of (
35
+ [
36
+ // Override the default keymap for Mod-Enter to not insert a new line, we have a custom event handler for executing queries
37
+ { key : 'Mod-Enter' , run : ( ) => true } ,
38
+
39
+ // Add the default keymap and history keymap
40
+ defaultKeymap ,
41
+ historyKeymap ,
42
+ ]
43
+ . flat ( )
44
+ . filter ( Boolean ) ,
45
+ ) ,
35
46
]
You can’t perform that action at this time.
0 commit comments