Browse Source

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

Devon Zuegel 4 years ago
parent
commit
d03a2f18d6
1 changed files with 8 additions and 5 deletions
  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]