Просмотр исходного кода

fix: can't auto change `【【` on Windows with Sougou Chinese input

Tienson Qin 4 лет назад
Родитель
Сommit
0061657d32
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/main/frontend/handler/editor.cljs

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

@@ -2463,7 +2463,7 @@
           value (gobj/get input "value")
           value (gobj/get input "value")
           c (util/nth-safe value (dec current-pos))]
           c (util/nth-safe value (dec current-pos))]
       (when-not (state/get-editor-show-input)
       (when-not (state/get-editor-show-input)
-        (when (and (= k "【")
+        (when (and (or (= k "[") (= k "【"))
                    (> current-pos 0)
                    (> current-pos 0)
                    (= "【" (util/nth-safe value (dec (dec current-pos)))))
                    (= "【" (util/nth-safe value (dec (dec current-pos)))))
           (commands/handle-step [:editor/input "[[]]" {:last-pattern "【【"
           (commands/handle-step [:editor/input "[[]]" {:last-pattern "【【"
@@ -2471,7 +2471,7 @@
           (commands/handle-step [:editor/search-page])
           (commands/handle-step [:editor/search-page])
           (reset! commands/*slash-caret-pos (util/get-caret-pos input)))
           (reset! commands/*slash-caret-pos (util/get-caret-pos input)))
 
 
-        (when (and (= k "(")
+        (when (and (or (= k "(") (= k "("))
                    (> current-pos 0)
                    (> current-pos 0)
                    (= "(" (util/nth-safe value (dec (dec current-pos)))))
                    (= "(" (util/nth-safe value (dec (dec current-pos)))))
           (commands/handle-step [:editor/input "(())" {:last-pattern "(("
           (commands/handle-step [:editor/input "(())" {:last-pattern "(("