Skip to content

Conversation

@jgrey4296
Copy link

this replaces the use of which-key-replacement-alist with the newer keymap-based-replacement approach of which-key.
It also enables evil-state based which-key bindings.

@leifhelm
Copy link

I have a configuration like this:

  (general-create-definer leader-keys
    :states '(normal insert visual emacs)
    :prefix "SPC"
    :global-prefix "C-SPC")

  (leader-keys
    "TAB" '(evil-switch-to-windows-last-buffer :which-key "Last buffer"))

It creates a message when i press SPC in normal mode:
Error running timer ‘which-key--update’: (wrong-type-argument listp "Last buffer")
And it does not display any replacements.

(replacement (cond ((consp wk) (cdr wk))
(t wk)))
;; check the map exists, if not, try adding -map to it. (ie: global -> global-map)
(real-keymap (if (boundp keymap) (symbol-value keymap) (symbol-value (intern (format "%s-map" keymap)))))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(real-keymap (if (boundp keymap) (symbol-value keymap) (symbol-value (intern (format "%s-map" keymap)))))
(real-keymap (general--get-keymap nil keymap nil t)))

Have a look at general--get-keymap. I found it while browsing general--define-key-dispatch

dramatically speeds up boot time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants