Skip to content

Commit

Permalink
Fix some keymap names not showing up
Browse files Browse the repository at this point in the history
Closes justbur#314.
  • Loading branch information
peniblec committed Jul 18, 2021
1 parent 55fcce0 commit 5ced001
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions which-key-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
("C-b" . "group:mymap")
("C-c" . "group:mymap2"))))))

(ert-deftest which-key-test--named-prefix-keymap ()
(define-prefix-command 'which-key-test--named-map)
(let ((map (make-sparse-keymap)))
(define-key map "\C-a" 'which-key-test--named-map)
(should (equal
(which-key--get-keymap-bindings map)
'(("C-a" . "which-key-test--named-map"))))))

(ert-deftest which-key-test--prefix-declaration ()
"Test `which-key-declare-prefixes' and
`which-key-declare-prefixes-for-mode'. See Bug #109."
Expand Down
2 changes: 1 addition & 1 deletion which-key.el
Original file line number Diff line number Diff line change
Expand Up @@ -1743,8 +1743,8 @@ Requires `which-key-compute-remaps' to be non-nil"
(binding
(cons key-desc
(cond
((keymapp def) "prefix")
((symbolp def) (which-key--compute-binding def))
((keymapp def) "prefix")
((eq 'lambda (car-safe def)) "lambda")
((eq 'closure (car-safe def)) "closure")
((stringp def) def)
Expand Down

0 comments on commit 5ced001

Please sign in to comment.