chore(code): reintroduce highlight active line & selection

This commit is contained in:
Elian Doran
2025-05-11 12:10:28 +03:00
parent 2628132350
commit ec72800b00
3 changed files with 42 additions and 4 deletions

View File

@@ -21,6 +21,7 @@
"dependencies": {
"@codemirror/commands": "6.8.1",
"@codemirror/legacy-modes": "6.5.1",
"@codemirror/search": "6.5.10",
"@codemirror/view": "6.36.7",
"codemirror-lang-hcl": "0.1.0"
}

View File

@@ -1,7 +1,8 @@
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
import { EditorView, keymap, lineNumbers, placeholder, ViewUpdate, type EditorViewConfig } from "@codemirror/view";
import { EditorView, highlightActiveLine, keymap, lineNumbers, placeholder, ViewUpdate, type EditorViewConfig } from "@codemirror/view";
import { defaultHighlightStyle, StreamLanguage, syntaxHighlighting, indentUnit } from "@codemirror/language";
import { Compartment } from "@codemirror/state";
import { highlightSelectionMatches } from "@codemirror/search";
import byMimeType from "./syntax_highlighting.js";
type ContentChangedListener = () => void;
@@ -26,6 +27,8 @@ export default class CodeMirror extends EditorView {
]),
languageCompartment.of([]),
syntaxHighlighting(defaultHighlightStyle),
highlightActiveLine(),
highlightSelectionMatches(),
lineNumbers(),
indentUnit.of(" ".repeat(4))
];