Bindings are ineffective until mode is changed
oscarfv opened this issue · 0 comments
oscarfv commented
After visiting a file and activating evil-paredit, the new bindings are ineffective until state is changed to Normal (even when the initial state is already Normal.)
Steps to reproduce:
- Visit a Lisp file
- Activate paredit-mode, if necessary
- Activate evil-paredit-mode, if necessary
- Put the cursor over a parenthesis.
- Press x
The parenthesis goes away. "M-x x" shows that the key is still bound to evil-delete-char. Now undo the change and press i to change to Insert mode and Esc to change back to Normal. Put the cursor over a parenthesis again and press x. This time the deletion doesn't happen, as expected, and "M-x x" shows that the key is bound to paredit-forward-delete, so the state brought evil-paredit to working state.
This is a fix suggested in the Evil mailing list:
(define-minor-mode evil-paredit-mode
"Minor mode for setting up Evil with paredit in a single buffer"
:keymap '()
(let ((prev-state evil-state))
(evil-normal-state)
(evil-change-state prev-state)))
The discussion in the mailing list: