[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 4042f06 34/39: Fix prefix bindings in which-key-show-major

From: Justin Burkett
Subject: [elpa] master 4042f06 34/39: Fix prefix bindings in which-key-show-major-mode
Date: Thu, 21 Jun 2018 15:48:18 -0400 (EDT)

branch: master
commit 4042f06564f450838c8ed79d7c0d1bce3124200d
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>

    Fix prefix bindings in which-key-show-major-mode
 which-key.el | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/which-key.el b/which-key.el
index c6b89ba..e371895 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1476,16 +1476,21 @@ which are strings. KEY is of the form produced by 
       (intern (cdr keydesc))))
 (defun which-key--map-binding-p (map keydesc)
+  "Does MAP contain KEYDESC = (key . binding)?"
    (when (bound-and-true-p evil-state)
-     (eq (which-key--safe-lookup-key
-          map
-          (kbd (which-key--current-key-string
-                (format "<%s-state> %s" evil-state (car keydesc)))))
-         (intern (cdr keydesc))))
-   (eq (which-key--safe-lookup-key
-        map (kbd (which-key--current-key-string (car keydesc))))
-       (intern (cdr keydesc)))))
+     (let ((lookup
+            (which-key--safe-lookup-key
+             map
+             (kbd (which-key--current-key-string
+                   (format "<%s-state> %s" evil-state (car keydesc)))))))
+       (or (eq lookup (intern (cdr keydesc)))
+           (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command")))))
+   (let ((lookup
+          (which-key--safe-lookup-key
+           map (kbd (which-key--current-key-string (car keydesc))))))
+     (or (eq lookup (intern (cdr keydesc)))
+         (and (keymapp lookup) (string= (cdr keydesc) "Prefix Command"))))))
 (defun which-key--pseudo-key (key &optional prefix)
   "Replace the last key in the sequence KEY by a special symbol

reply via email to

[Prev in Thread] Current Thread [Next in Thread]