fix(api): safety key string for the simple command key value

pull/10751/head
charlie 2023-12-22 12:26:01 +08:00 committed by Tienson Qin
parent b7c2a7b8f5
commit 3934efb537
1 changed files with 1 additions and 1 deletions

View File

@ -349,7 +349,7 @@
(fn [pid ^js cmd-action palette?]
(when-let [[cmd action] (bean/->clj cmd-action)]
(let [action (assoc action 0 (keyword (first action)))
cmd (assoc cmd :key (string/replace (:key cmd) ":" "-"))
cmd (assoc cmd :key (-> (:key cmd) (string/trim) (string/replace ":" "-") (string/replace #"^([0-9])" "_$1")))
key (:key cmd)
keybinding (:keybinding cmd)
palette-cmd (plugin-handler/simple-cmd->palette-cmd pid cmd action)