Set CodeMirror mode when editing files

pull/645/head
Tienson Qin 2020-10-09 22:52:48 +08:00
parent f2fc65bb36
commit 9e3702bd8c
1 changed files with 3 additions and 2 deletions

View File

@ -121,9 +121,10 @@
(and format (contains? (config/text-formats) format))
(when-let [file-content (db/get-file path)]
(let [content (string/trim file-content)]
(let [content (string/trim file-content)
mode (util/get-file-ext path)]
(lazy-editor/editor {:file? true
:file-path path} path nil content nil)))
:file-path path} path {:data-lang mode} content nil)))
:else
[:div (tongue :file/format-not-supported (name format))])])))