enhance: type ``` and press Enter to switch to codemirror

This commit is contained in:
Tienson Qin
2021-11-26 21:04:10 +08:00
parent a5674b1728
commit b8e3298904
4 changed files with 79 additions and 58 deletions

View File

@@ -2431,7 +2431,12 @@
(+ (string/index-of content right-bound pos)
(count right-bound))))
"admonition-block" (keydown-new-line)
"source-block" (keydown-new-line)
"source-block" (do
(keydown-new-line)
(case (:action thing-at-point)
:into-code-editor
(state/into-code-editor-mode!)
nil))
"block-ref" (open-block-in-sidebar! (:link thing-at-point))
"page-ref" (when-not (string/blank? (:link thing-at-point))
(insert-first-page-block-if-not-exists! (:link thing-at-point))