branch: externals/which-key commit ba03e7e5bcbe3f7d95be2cfddd71454151bb98c8 Author: D.K <beerand...@gmail.com> Commit: Justin Burkett <jus...@burkett.cc>
Add translation keymap support (#210) --- which-key-tests.el | 7 +++++-- which-key.el | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/which-key-tests.el b/which-key-tests.el index 3e75d6f..cff7fab 100644 --- a/which-key-tests.el +++ b/which-key-tests.el @@ -130,20 +130,23 @@ (define-key map "c" "c") (define-key map "dd" "dd") (define-key map "eee" "eee") + (define-key map "f" [123 45 6]) (should (equal (sort (which-key--get-keymap-bindings map) (lambda (a b) (string-lessp (car a) (car b)))) '(("b" . "ignore") ("c" . "c") ("d" . "Prefix Command") - ("e" . "Prefix Command")))) + ("e" . "Prefix Command") + ("f" . "{ - C-f")))) (should (equal (sort (which-key--get-keymap-bindings map t) (lambda (a b) (string-lessp (car a) (car b)))) '(("b" . "ignore") ("c" . "c") ("d d" . "dd") - ("e e e" . "eee")))))) + ("e e e" . "eee") + ("f" . "{ - C-f")))))) (provide 'which-key-tests) ;;; which-key-tests.el ends here diff --git a/which-key.el b/which-key.el index f4b15c4..99318d5 100644 --- a/which-key.el +++ b/which-key.el @@ -1741,6 +1741,7 @@ ones. PREFIX is for internal use and should not be used." ((eq 'lambda (car-safe def)) "lambda") ((eq 'menu-item (car-safe def)) "menu-item") ((stringp def) def) + ((vectorp def) (key-description def)) (t "unknown"))) bindings :test (lambda (a b) (string= (car a) (car b))))))))) keymap)