mirror of https://github.com/logseq/logseq
perf: no need to clear-edit! when editing new block
parent
02160042fb
commit
d08102444d
|
@ -679,10 +679,6 @@
|
|||
(undo-redo/record-editor-info! repo (ldb/read-transit-str editor-info-str))
|
||||
nil)
|
||||
|
||||
(keep-alive
|
||||
[_this]
|
||||
"alive")
|
||||
|
||||
(dangerousRemoveAllDbs
|
||||
[this repo]
|
||||
(p/let [dbs (.listDB this)]
|
||||
|
@ -717,6 +713,7 @@
|
|||
(rename-page! repo conn page-uuid new-name))
|
||||
:delete-page (fn [repo conn [page-uuid]]
|
||||
(delete-page! repo conn page-uuid))}))
|
||||
|
||||
(defn init
|
||||
"web worker entry"
|
||||
[]
|
||||
|
|
|
@ -173,8 +173,6 @@
|
|||
(defn- edit-block-aux
|
||||
[repo block content text-range {:keys [container-id]}]
|
||||
(when block
|
||||
(when (not= (:db/id block) (:db/id (state/get-edit-block)))
|
||||
(state/clear-edit!))
|
||||
(let [container-id (or container-id
|
||||
(state/get-current-editor-container-id)
|
||||
:unknown-container)]
|
||||
|
|
|
@ -67,8 +67,9 @@
|
|||
([input n] (move-cursor-to input n false))
|
||||
([input n delay?]
|
||||
(.setSelectionRange input n n)
|
||||
(when-not (= js/document.activeElement input)
|
||||
(let [focus #(.focus input)]
|
||||
(if delay? (js/setTimeout focus 16) (focus)))))
|
||||
(if delay? (js/setTimeout focus 16) (focus))))))
|
||||
|
||||
(defn move-cursor-forward
|
||||
([input]
|
||||
|
|
Loading…
Reference in New Issue