mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-01 12:27:41 +08:00
chore(code): reintroduce history (undo-redo)
This commit is contained in:
parent
67d1868078
commit
a4054dfa42
@ -1,4 +1,4 @@
|
||||
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
|
||||
import { defaultKeymap, history, historyKeymap, indentWithTab } from "@codemirror/commands";
|
||||
import { EditorView, highlightActiveLine, keymap, lineNumbers, placeholder, ViewUpdate, type EditorViewConfig } from "@codemirror/view";
|
||||
import { defaultHighlightStyle, StreamLanguage, syntaxHighlighting, indentUnit, bracketMatching } from "@codemirror/language";
|
||||
import { Compartment } from "@codemirror/state";
|
||||
@ -21,17 +21,19 @@ export default class CodeMirror extends EditorView {
|
||||
constructor(config: EditorConfig) {
|
||||
const languageCompartment = new Compartment();
|
||||
let extensions = [
|
||||
keymap.of([
|
||||
...defaultKeymap,
|
||||
indentWithTab
|
||||
]),
|
||||
languageCompartment.of([]),
|
||||
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
||||
highlightActiveLine(),
|
||||
highlightSelectionMatches(),
|
||||
bracketMatching(),
|
||||
lineNumbers(),
|
||||
indentUnit.of(" ".repeat(4))
|
||||
indentUnit.of(" ".repeat(4)),
|
||||
history(),
|
||||
keymap.of([
|
||||
...defaultKeymap,
|
||||
...historyKeymap,
|
||||
indentWithTab
|
||||
]),
|
||||
];
|
||||
|
||||
if (Array.isArray(config.extensions)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user