Merge branch 'master' of github.com:logseq/logseq

This commit is contained in:
Tienson Qin
2021-03-27 23:11:33 +08:00
4 changed files with 16 additions and 5 deletions

View File

@@ -110,7 +110,7 @@
(let [{:keys [block typ show?]} block-data
block-id (or (:block/uuid (state/get-edit-block))
(:block/uuid block))
typ (or typ @commands/*current-command)]
typ (or @commands/*current-command typ)]
(editor-handler/set-block-timestamp! block-id
typ
text)

View File

@@ -171,7 +171,8 @@
(distinct))
properties (->> properties
(medley/map-kv (fn [k v]
(let [v (string/trim v)]
(let [v (string/trim v)
k (string/replace k " " "_")]
(cond
(and (= "\"" (first v) (last v))) ; wrapped in ""
[(string/lower-case k) (string/trim (subs v 1 (dec (count v))))]

View File

@@ -1418,7 +1418,10 @@
(when (and (if check-idle? (state/input-idle? repo) true)
(not (state/get-editor-show-page-search?))
(not (state/get-editor-show-page-search-hashtag?))
(not (state/get-editor-show-block-search?)))
(not (state/get-editor-show-block-search?))
(not (state/get-editor-show-date-picker?))
(not (state/get-editor-show-template-search?))
(not (state/get-editor-show-input)))
(state/set-editor-op! :auto-save)
(try
(let [input-id (state/get-edit-input-id)
@@ -2366,8 +2369,9 @@
(defn- on-arrow-move-to-boundray
[state input e direction]
(when (or (and (= :left direction) (util/input-start? input))
(and (= :right direction) (util/input-end? input)))
(when (and (not (util/input-selected? input))
(or (and (= :left direction) (util/input-start? input))
(and (= :right direction) (util/input-end? input))))
(move-to-block-when-cross-boundrary state e direction)))
(defn keydown-arrow-handler

View File

@@ -765,6 +765,12 @@
(= (count (.-value input))
(.-selectionStart input)))))
#?(:cljs
(defn input-selected?
[input]
(not= (.-selectionStart input)
(.-selectionEnd input))))
#?(:cljs
(defn get-selected-text
[]