Skip to content

Build your personal knowledge base with Trilium Notes

chore(code): reintroduce highlight active line & selection

Elian Doranec72800b0052
diff --git a/packages/codemirror/package.json b/packages/codemirror/package.json
index fdf4319279..f56d2affe1 100644
--- a/packages/codemirror/package.json
+++ b/packages/codemirror/package.json
@@ -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"
}
diff --git a/packages/codemirror/src/index.ts b/packages/codemirror/src/index.ts
index a56829a1e1..1e821c535d 100644
--- a/packages/codemirror/src/index.ts
+++ b/packages/codemirror/src/index.ts
@@ -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))
];
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8fc0ba49c9..5fcec2fed7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1160,6 +1160,9 @@ importers:
'@codemirror/legacy-modes':
specifier: 6.5.1
version: 6.5.1
+ '@codemirror/search':
+ specifier: 6.5.10
+ version: 6.5.10
'@codemirror/view':
specifier: 6.36.7
version: 6.36.7
@@ -2160,6 +2163,9 @@ packages:
'@codemirror/[email protected]':
resolution: {integrity: sha512-DJYQQ00N1/KdESpZV7jg9hafof/iBNp9h7TYo1SLMk86TWl9uDsVdho2dzd81K+v4retmK6mdC7WpuOQDytQqw==}
+ '@codemirror/[email protected]':
+ resolution: {integrity: sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==}
+
'@codemirror/[email protected]':
resolution: {integrity: sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==}
@@ -6593,6 +6599,9 @@ packages:
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
+ resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
+
resolution: {integrity: sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==}
@@ -15020,6 +15029,15 @@ snapshots:
- supports-color
- utf-8-validate
+ '@ckeditor/[email protected]':
+ dependencies:
+ '@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-engine': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-heading': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-typing': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-utils': 45.0.0([email protected])([email protected])
+ ckeditor5: 45.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
+
dependencies:
'@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
@@ -15666,6 +15684,14 @@ snapshots:
- supports-color
- utf-8-validate
+ '@ckeditor/[email protected]':
+ dependencies:
+ '@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-icons': 45.0.0
+ '@ckeditor/ckeditor5-ui': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-utils': 45.0.0([email protected])([email protected])
+ ckeditor5: 45.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
+
dependencies:
'@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
@@ -16261,7 +16287,7 @@ snapshots:
'@ckeditor/ckeditor5-find-and-replace': 45.0.0
'@ckeditor/ckeditor5-font': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-heading': 45.0.0([email protected])([email protected])
- '@ckeditor/ckeditor5-highlight': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-highlight': 45.0.0
'@ckeditor/ckeditor5-icons': 45.0.0
'@ckeditor/ckeditor5-image': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-link': 45.0.0([email protected])([email protected])
@@ -16404,6 +16430,12 @@ snapshots:
dependencies:
'@codemirror/language': 6.11.0
+ '@codemirror/[email protected]':
+ dependencies:
+ '@codemirror/state': 6.5.2
+ '@codemirror/view': 6.36.7
+ crelt: 1.0.6
+
'@codemirror/[email protected]':
dependencies:
'@marijn/find-cluster-break': 1.0.2
@@ -21577,7 +21609,7 @@ snapshots:
dependencies:
'@ckeditor/ckeditor5-adapter-ckfinder': 45.0.0
'@ckeditor/ckeditor5-alignment': 45.0.0([email protected])([email protected])
- '@ckeditor/ckeditor5-autoformat': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-autoformat': 45.0.0
'@ckeditor/ckeditor5-autosave': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-basic-styles': 45.0.0
'@ckeditor/ckeditor5-block-quote': 45.0.0
@@ -21602,7 +21634,7 @@ snapshots:
'@ckeditor/ckeditor5-font': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-fullscreen': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-heading': 45.0.0([email protected])([email protected])
- '@ckeditor/ckeditor5-highlight': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-highlight': 45.0.0
'@ckeditor/ckeditor5-horizontal-line': 45.0.0
'@ckeditor/ckeditor5-html-embed': 45.0.0
'@ckeditor/ckeditor5-html-support': 45.0.0
@@ -22024,6 +22056,8 @@ snapshots:
+