mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
fix: can't undo on CodeMirror blocks
This commit is contained in:
@@ -552,8 +552,7 @@
|
||||
|
||||
:shortcut.handler/editor-global
|
||||
(->
|
||||
(build-category-map [
|
||||
:graph/export-as-html
|
||||
(build-category-map [:graph/export-as-html
|
||||
:graph/open
|
||||
:graph/remove
|
||||
:graph/add
|
||||
@@ -580,7 +579,9 @@
|
||||
:editor/copy
|
||||
:editor/copy-text
|
||||
:editor/cut
|
||||
:command/toggle-favorite])
|
||||
:command/toggle-favorite
|
||||
:editor/undo
|
||||
:editor/redo])
|
||||
(with-meta {:before m/enable-when-not-component-editing!}))
|
||||
|
||||
:shortcut.handler/global-prevent-default
|
||||
@@ -590,8 +591,7 @@
|
||||
:editor/zoom-in
|
||||
:editor/zoom-out
|
||||
:editor/toggle-undo-redo-mode
|
||||
:editor/undo
|
||||
:editor/redo
|
||||
|
||||
:ui/toggle-brackets
|
||||
:go/search-in-page
|
||||
:go/search
|
||||
|
||||
@@ -1560,12 +1560,6 @@ Similar to re-frame subscriptions"
|
||||
(when-let [tldraw-el (.querySelector js/document.body ".logseq-tldraw[data-tlapp]")]
|
||||
(gobj/get js/window.tlapps (.. tldraw-el -dataset -tlapp))))
|
||||
|
||||
(defn tldraw-editing-logseq-block?
|
||||
[]
|
||||
(when-let [app (active-tldraw-app)]
|
||||
(and (= 1 (.. app -selectedShapesArray -length))
|
||||
(= (.. app -editingShape) (.. app -selectedShapesArray (at 0))))))
|
||||
|
||||
(defn set-graph-syncing?
|
||||
[value]
|
||||
(set-state! :graph/syncing? value))
|
||||
@@ -1737,14 +1731,9 @@ Similar to re-frame subscriptions"
|
||||
[args]
|
||||
(set-state! :editor/args args))
|
||||
|
||||
(defn editing-whiteboard-portal?
|
||||
[]
|
||||
(and (active-tldraw-app) (tldraw-editing-logseq-block?)))
|
||||
|
||||
(defn block-component-editing?
|
||||
[]
|
||||
(and (:block/component-editing-mode? @state)
|
||||
(not (editing-whiteboard-portal?))))
|
||||
(:block/component-editing-mode? @state))
|
||||
|
||||
(defn set-block-component-editing-mode!
|
||||
[value]
|
||||
|
||||
Reference in New Issue
Block a user