feat: add :shortcut/doc-mode-enter-for-new-block? option

This commit is contained in:
Tienson Qin
2021-09-23 18:26:11 +08:00
parent 23a9b3e068
commit e5f484d1a7
4 changed files with 20 additions and 12 deletions

View File

@@ -2266,14 +2266,14 @@
(cursor/move-cursor-to input (inc selected-start)))))
(defn keydown-new-block-handler [state e]
(if (state/get-new-block-toggle?)
(if (state/doc-mode-enter-for-new-line?)
(keydown-new-line)
(do
(.preventDefault e)
(keydown-new-block state))))
(defn keydown-new-line-handler [state e]
(if (state/get-new-block-toggle?)
(if (state/doc-mode-enter-for-new-line?)
(keydown-new-block state)
(do
(.preventDefault e)