From ec76d9acb60bad35be6343888fe70ae2f918bfb0 Mon Sep 17 00:00:00 2001 From: Jeffrey Chu Date: Sun, 31 Mar 2019 12:38:42 -0700 Subject: [PATCH] Escape key regexps when building which-key leader prefix --- core/core-keybinds.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index 86fb7f6c0..b8130b202 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -124,8 +124,8 @@ If any hook returns non-nil, all hooks after it are ignored.") (concat "\\(?:" (cl-loop for key in (append (list doom-leader-key doom-leader-alt-key) (where-is-internal 'doom/leader)) - if (stringp key) collect key into keys - else collect (key-description key) into keys + if (stringp key) collect (regexp-quote key) into keys + else collect (regexp-quote (key-description key)) into keys finally return (string-join keys "\\|")) "\\)")))) (add-hook 'doom-after-init-modules-hook #'doom|init-leader-keys)