Skip to content

Commit

Permalink
fix(vision): fixes bug where codemirror would insert a new line on cm…
Browse files Browse the repository at this point in the history
…d-return
  • Loading branch information
sgulseth committed Mar 24, 2024
1 parent 1352e84 commit 307fec9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@sanity/vision/src/codemirror/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
syntaxHighlighting,
} from '@codemirror/language'
import {highlightSelectionMatches} from '@codemirror/search'
import {Extension} from '@codemirror/state'
import {type Extension} from '@codemirror/state'
import {
drawSelection,
highlightActiveLine,
Expand All @@ -31,5 +31,7 @@ export const codemirrorExtensions: Extension[] = [
history(),
drawSelection(),
syntaxHighlighting(defaultHighlightStyle, {fallback: true}),
keymap.of([defaultKeymap, historyKeymap].flat().filter(Boolean)),
keymap.of(
[{key: 'Mod-Enter', run: () => true}, defaultKeymap, historyKeymap].flat().filter(Boolean),
),
]

0 comments on commit 307fec9

Please sign in to comment.