Adds highlight on current indentation mark to code editor (#21972)

* Adds highlight on current indentation mark to code editor

* code review
This commit is contained in:
Miguel Palhas 2024-09-25 12:35:47 +01:00 committed by GitHub
parent e687ddab21
commit 2793ca65cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 0 deletions

View File

@ -87,6 +87,7 @@
"@polymer/paper-listbox": "3.0.1",
"@polymer/paper-tabs": "3.1.0",
"@polymer/polymer": "3.5.1",
"@replit/codemirror-indentation-markers": "6.5.3",
"@thomasloven/round-slider": "0.6.0",
"@vaadin/combo-box": "24.4.9",
"@vaadin/vaadin-themable-mixin": "24.4.9",

View File

@ -180,6 +180,14 @@ export class HaCodeEditor extends ReactiveElement {
this._loadedCodeMirror.crosshairCursor(),
this._loadedCodeMirror.highlightSelectionMatches(),
this._loadedCodeMirror.highlightActiveLine(),
this._loadedCodeMirror.indentationMarkers({
thickness: 0,
activeThickness: 1,
colors: {
activeLight: "var(--secondary-text-color)",
activeDark: "var(--secondary-text-color)",
},
}),
this._loadedCodeMirror.keymap.of([
...this._loadedCodeMirror.defaultKeymap,
...this._loadedCodeMirror.searchKeymap,

View File

@ -25,6 +25,7 @@ export {
lineNumbers,
rectangularSelection,
} from "@codemirror/view";
export { indentationMarkers } from "@replit/codemirror-indentation-markers";
export { tags } from "@lezer/highlight";
export const langs = {

View File

@ -3713,6 +3713,17 @@ __metadata:
languageName: node
linkType: hard
"@replit/codemirror-indentation-markers@npm:6.5.3":
version: 6.5.3
resolution: "@replit/codemirror-indentation-markers@npm:6.5.3"
peerDependencies:
"@codemirror/language": ^6.0.0
"@codemirror/state": ^6.0.0
"@codemirror/view": ^6.0.0
checksum: 10/9292734a228038805bdf72ed2c6cdd70e7b7f87090d6d07bb64af4ac986ea277349409f4d52c2863128d4b481ea8a094c2486d7d677875d47336a52cb15fc4ed
languageName: node
linkType: hard
"@rollup/plugin-babel@npm:6.0.4":
version: 6.0.4
resolution: "@rollup/plugin-babel@npm:6.0.4"
@ -8958,6 +8969,7 @@ __metadata:
"@polymer/paper-listbox": "npm:3.0.1"
"@polymer/paper-tabs": "npm:3.1.0"
"@polymer/polymer": "npm:3.5.1"
"@replit/codemirror-indentation-markers": "npm:6.5.3"
"@rollup/plugin-babel": "npm:6.0.4"
"@rollup/plugin-commonjs": "npm:26.0.1"
"@rollup/plugin-json": "npm:6.1.0"