mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08:00
feat(code): enable line numbers
This commit is contained in:
parent
cfa8987b25
commit
c84a390699
@ -1,12 +1,13 @@
|
|||||||
import { defaultKeymap } from "@codemirror/commands";
|
import { defaultKeymap } from "@codemirror/commands";
|
||||||
import { EditorView, keymap, type EditorViewConfig } from "@codemirror/view";
|
import { EditorView, keymap, lineNumbers, type EditorViewConfig } from "@codemirror/view";
|
||||||
|
|
||||||
export default class CodeMirror extends EditorView {
|
export default class CodeMirror extends EditorView {
|
||||||
constructor(config: EditorViewConfig) {
|
constructor(config: EditorViewConfig) {
|
||||||
super({
|
super({
|
||||||
...config,
|
...config,
|
||||||
extensions: [
|
extensions: [
|
||||||
keymap.of(defaultKeymap)
|
keymap.of(defaultKeymap),
|
||||||
|
lineNumbers()
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user