-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulated keys are not shown with which-key #78
Comments
Sorry, I hadn't added documentation to the readme for this change yet. There are two ways of getting this behavior now with general's default method for You can set The other (recommended) way is to set the no-lookup argument I'll close this after adding documentation to the readme. |
Thank you that solution is working. It was vaguely hinted in the documentation, but I couldn't figure out how to get that specific behavior. So a clarification there would be greatly appreciated. Once again thank you for your work. |
I ran into this. Previously, this: (general-nvmap :prefix "SPC"
...
"p" (general-simulate-keys
"C-c p" t
"Projectile"
general-SPC-simulates-C-c-p)
...) Showed "Projectile" if I pressed The following works, but it sets the "p" (general-simulate-keys
"C-c p" t
nil
"Projectile") Any hints (other than 'yeah, learn elisp! ;-)') |
If I understand correctly that function takes So I guess you could try to use: (general-simulate-keys "C-c p" nil nil t "Projectile" general-SPC-simulates-C-c-p) |
That's correct. All general functions/macros have docstrings, so if you're in doubt, you can always |
Thanks both, but that still shows "general-SPC-simulates-C-c-p" in |
If I remember correctly, |
That's perfect @noctuid - thanks! |
I've tried to avoid any serious breaking changes, but in this case, since there have already been breaing changes to |
Makes sense to me. If you are worried about breaking changes then you could also use a new function and mark the old one as deprecated (assuming emacs’ lisp has such a notion). My vote for the new name is ‘press-this-instead’ :-). |
- add back key simulation tests - general-simulate-keys (obsolete) -> general-simulate-key - uses keyword arguments instead of positional arguments - lookup defaults to t but only works for matched commands by default (re #78) - fix bug where simulating a command and keys with a count would affect the next command - general--parse-keymap (obsolete) -> general--get-keymap - keymap argument is now optional - now supports both symbols and keymaps for the keymap argument - general--key-lookup -> general--key-binding - only use for getting match; don't use to get auxiliary map
I've fixed this issue in the |
- add back key simulation tests - general-simulate-keys (obsolete) -> general-simulate-key - uses keyword arguments instead of positional arguments - lookup defaults to t but only works for matched commands by default (re #78) - fix bug where simulating a command and keys with a count would affect the next command - general--parse-keymap (obsolete) -> general--get-keymap - keymap argument is now optional - now supports both symbols and keymaps for the keymap argument - general--key-lookup -> general--key-binding - only use for getting match; don't use to get auxiliary map
The branch is now merged. |
Earlier when I tried, which-key displayed the mapped simulated key help when I pressed it. Currently nothing is shown by which-key when a simulated key is used.
For example (when using projectile):
(general-define-key :keymaps '(normal visual) "SPC" (general-simulate-keys "C-c"))
If you don't press another key which-key won't display any bindings for C-c.
The text was updated successfully, but these errors were encountered: