fix: cmd-k search deletes unsaved changes

fixes https://github.com/logseq/db-test/issues/27
This commit is contained in:
Tienson Qin
2024-08-23 14:55:47 +08:00
parent f11932e0c5
commit 69816cdd2b
2 changed files with 8 additions and 6 deletions

View File

@@ -3814,10 +3814,12 @@
([]
(escape-editing true))
([select?]
(if select?
(when-let [node (some-> (state/get-input) (util/rec-get-node "ls-block"))]
(state/exit-editing-and-set-selected-blocks! [node]))
(state/clear-edit!))))
(p/do!
(save-current-block!)
(if select?
(when-let [node (some-> (state/get-input) (util/rec-get-node "ls-block"))]
(state/exit-editing-and-set-selected-blocks! [node]))
(state/clear-edit!)))))
(defn replace-block-reference-with-content-at-point
[]