Explorar o código

fix: tag with page references

Tienson Qin %!s(int64=4) %!d(string=hai) anos
pai
achega
3ca38044cd
Modificáronse 2 ficheiros con 10 adicións e 11 borrados
  1. 9 9
      src/main/frontend/handler/editor.cljs
  2. 1 2
      src/main/frontend/state.cljs

+ 9 - 9
src/main/frontend/handler/editor.cljs

@@ -2325,15 +2325,6 @@
               (= "#" (util/nth-safe value (dec pos)))))
               (= "#" (util/nth-safe value (dec pos)))))
         (state/set-editor-show-page-search-hashtag! false)
         (state/set-editor-show-page-search-hashtag! false)
 
 
-        (or
-         (surround-by? input "#" " ")
-         (surround-by? input "#" :end)
-         (= key "#"))
-        (do
-          (commands/handle-step [:editor/search-page-hashtag])
-          (state/set-last-pos! (:pos (util/get-caret-pos input)))
-          (reset! commands/*slash-caret-pos (util/get-caret-pos input)))
-
         (and
         (and
          (contains? (set/difference (set (keys reversed-autopair-map))
          (contains? (set/difference (set (keys reversed-autopair-map))
                                     #{"`"})
                                     #{"`"})
@@ -2359,6 +2350,15 @@
             :else
             :else
             nil))
             nil))
 
 
+        (or
+         (surround-by? input "#" " ")
+         (surround-by? input "#" :end)
+         (= key "#"))
+        (do
+          (commands/handle-step [:editor/search-page-hashtag])
+          (state/set-last-pos! (:pos (util/get-caret-pos input)))
+          (reset! commands/*slash-caret-pos (util/get-caret-pos input)))
+
         (let [sym "$"]
         (let [sym "$"]
           (and (= key sym)
           (and (= key sym)
                (>= (count value) 1)
                (>= (count value) 1)

+ 1 - 2
src/main/frontend/state.cljs

@@ -464,8 +464,7 @@
 
 
 (defn set-editor-show-page-search!
 (defn set-editor-show-page-search!
   [value]
   [value]
-  (set-state! :editor/show-page-search? value)
-  (set-state! :editor/show-page-search-hashtag? false))
+  (set-state! :editor/show-page-search? value))
 
 
 (defn get-editor-show-page-search?
 (defn get-editor-show-page-search?
   []
   []