Explorar o código

enhance: replace left/right keyboard display with ←/→

Devon Zuegel %!s(int64=4) %!d(string=hai) anos
pai
achega
d03a2f18d6
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      src/main/frontend/util.cljc

+ 8 - 5
src/main/frontend/util.cljc

@@ -1130,11 +1130,14 @@
 
 (defn ->platform-shortcut
   [keyboard-shortcut]
-  (if mac?
-    (-> keyboard-shortcut
-        (string/replace "Ctrl" "Cmd")
-        (string/replace "Alt" "Opt"))
-    keyboard-shortcut))
+  (let [result (or keyboard-shortcut "")
+        result (string/replace result "left" "←")
+        result (string/replace result "right" "→")]
+    (if mac?
+      (-> result
+          (string/replace "Ctrl" "Cmd")
+          (string/replace "Alt" "Opt"))
+      result)))
 
 (defn remove-common-preceding
   [col1 col2]