Browse Source

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

Tienson Qin 4 years ago
parent
commit
cceb1e7fc0

+ 1 - 1
src/main/frontend/components/datetime.cljs

@@ -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)

+ 2 - 1
src/main/frontend/format/block.cljs

@@ -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))))]

+ 7 - 3
src/main/frontend/handler/editor.cljs

@@ -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

+ 6 - 0
src/main/frontend/util.cljc

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