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

@@ -688,7 +688,6 @@
(defn drop-last-selection-block!
[]
(def blocks (:selection/blocks @state))
(let [last-block (peek (vec (:selection/blocks @state)))]
(swap! state assoc
:selection/mode true
@@ -874,6 +873,12 @@
:editor/block nil
:cursor-range nil}))
(defn into-code-editor-mode!
[]
(swap! state merge {:editor/editing? nil
:cursor-range nil
:editor/code-mode? true}))
(defn set-last-pos!
[new-pos]
(set-state! :editor/last-saved-cursor new-pos))