Przeglądaj źródła

fix: #3283 broken @Rime

Junyi Du 3 lat temu
rodzic
commit
1da7040247
1 zmienionych plików z 7 dodań i 6 usunięć
  1. 7 6
      src/main/frontend/handler/editor.cljs

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

@@ -2788,10 +2788,14 @@
           metaKey (gobj/get e "metaKey")
           pos (cursor/pos input)
           shift? (.-shiftKey e)
-          code (gobj/getValueByKeys e "event_" "code")]
+          code (gobj/getValueByKeys e "event_" "code")
+          hashtag? (or (surround-by? input "#" " ")
+                       (surround-by? input "#" :end)
+                       (= key "#"))]
       (cond
         (and (util/event-is-composing? e true) ;; #3218
-             (not (state/get-editor-show-page-search-hashtag?))) ;; #3283
+             (not hashtag?) ;; #3283 @Rime
+             (not (state/get-editor-show-page-search-hashtag?))) ;; #3283 @MacOS pinyin
         nil
 
         (or ctrlKey metaKey)
@@ -2836,10 +2840,7 @@
           (util/stop e)
           (autopair input-id key format nil))
 
-        (or
-         (surround-by? input "#" " ")
-         (surround-by? input "#" :end)
-         (= key "#"))
+        hashtag?
         (do
           (commands/handle-step [:editor/search-page-hashtag])
           (state/set-last-pos! (cursor/pos input))