|
1 | 1 | import React, { useMemo, useRef } from "react"; |
2 | 2 | import { defaultKeymap, indentWithTab } from "@codemirror/commands"; |
3 | | -import { foldKeymap } from "@codemirror/language"; |
| 3 | +import { defaultHighlightStyle, foldKeymap } from "@codemirror/language"; |
4 | 4 | import { EditorState, Extension, Compartment } from "@codemirror/state"; |
5 | 5 | import { DOMEventHandlers, EditorView, KeyBinding, keymap, Rect, ViewUpdate } from "@codemirror/view"; |
6 | 6 | import { minimalSetup } from "codemirror"; |
@@ -30,7 +30,9 @@ import { |
30 | 30 | adaptedHighlightSpecialChars, |
31 | 31 | adaptedLineNumbers, |
32 | 32 | adaptedLintGutter, |
33 | | - adaptedPlaceholder, compartment, |
| 33 | + adaptedPlaceholder, |
| 34 | + compartment, |
| 35 | + adaptedSyntaxHighlighting, |
34 | 36 | } from "./tests/codemirrorTestHelper"; |
35 | 37 | import { ExtensionCreator } from "./types"; |
36 | 38 |
|
@@ -353,6 +355,7 @@ export const CodeEditor = ({ |
353 | 355 | wrapLinesCompartment.current.of(addExtensionsFor(wrapLines, EditorView?.lineWrapping)), |
354 | 356 | supportCodeFoldingCompartment.current.of(addExtensionsFor(supportCodeFolding, adaptedFoldGutter(), adaptedCodeFolding())), |
355 | 357 | useLintingCompartment.current.of(addExtensionsFor(useLinting, ...linters)), |
| 358 | + adaptedSyntaxHighlighting(defaultHighlightStyle), |
356 | 359 | additionalExtensions, |
357 | 360 | ]; |
358 | 361 |
|
|
0 commit comments