Browse Source

feat: add tab handling to editor

main
Inhji Y. 8 months ago
parent
commit
24f99a54e5
  1. 3
      assets/js/editor.js

3
assets/js/editor.js

@ -1,7 +1,7 @@
import {keymap, EditorView} from "@codemirror/view"
import {EditorState} from "@codemirror/state"
import {history, historyKeymap} from "@codemirror/history"
import {defaultKeymap} from "@codemirror/commands"
import {defaultKeymap, defaultTabBinding} from "@codemirror/commands"
import {defaultHighlightStyle} from "@codemirror/highlight"
import {markdown} from "@codemirror/lang-markdown"
import {oneDark} from "@codemirror/theme-one-dark"
@ -28,6 +28,7 @@ export default function initEditor(element) {
defaultHighlightStyle,
keymap.of([
...defaultKeymap,
...defaultTabBinding,
...historyKeymap
]),
]

Loading…
Cancel
Save