Open Vonfry opened 3 years ago
Thanks for the bug report. I thought I'd found the cause of this, but actually it's not so simple. This one may take a while!
This is because evil-normalize-keymaps
is not executed after every cursor movement - and in particular not when the cursor enters an overlay with a keymap
property. E.g. try changing states while on the button with a<ESC>
: Now the e
binding works.
My preferred workaround is to use extended menu items:
(define-key scratch-test--button-map "e" `(menu-item "" scratch-test--message :filter ,(lambda (cmd) (when (evil-normal-state-p) cmd)))))
with :filter
as appropriate.
Issue type
Environment
Emacs version:
GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.16.0)
Operating System:Linux pc-lab-shmtu 5.10.37 #1-NixOS SMP Fri May 14 07:50:46 UTC 2021 x86_64 GNU/Linux
Evil version:Evil version 1.14.0
Evil installation type: MELPA through nix-community/emacs-overlay Graphical/Terminal: Grahpical Tested in amake emacs
session (see CONTRIBUTING.md): NoReproduction steps
*scratch*
scratch-insert-button
somewhere you want. Now, pressi
on button will print hello.e
on that button but the behaviour is same as origin. It is the problem.b
on that button and it works as expection.