diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index 8388d423be..1ec42a3dd8 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -126,6 +126,7 @@ export class HaCodeEditor extends UpdatingElement { this._loadedCodeMirror.history(), this._loadedCodeMirror.highlightSelectionMatches(), this._loadedCodeMirror.highlightActiveLine(), + this._loadedCodeMirror.drawSelection(), this._loadedCodeMirror.rectangularSelection(), this._loadedCodeMirror.keymap.of([ ...this._loadedCodeMirror.defaultKeymap, diff --git a/src/resources/codemirror.ts b/src/resources/codemirror.ts index e8162732a3..3ddbce40ad 100644 --- a/src/resources/codemirror.ts +++ b/src/resources/codemirror.ts @@ -6,7 +6,7 @@ import { yaml } from "@codemirror/legacy-modes/mode/yaml"; import { indentLess, indentMore } from "@codemirror/commands"; import { Compartment } from "@codemirror/state"; -export { keymap, highlightActiveLine } from "@codemirror/view"; +export { keymap, highlightActiveLine, drawSelection } from "@codemirror/view"; export { CMEditorView as EditorView }; export { EditorState, Prec } from "@codemirror/state"; export { defaultKeymap } from "@codemirror/commands"; @@ -49,6 +49,10 @@ export const theme = CMEditorView.theme({ backgroundColor: "rgba(var(--rgb-primary-color), 0.3)", }, + ".cm-activeLine": { + backgroundColor: "rgba(var(--rgb-secondary-text-color), 0.1)", + }, + ".cm-scroller": { outline: "none" }, ".cm-content": { caretColor: "var(--secondary-text-color)" },