Skip to content
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

Bindings are ineffective until mode is changed #7

Closed
oscarfv opened this issue Mar 19, 2013 · 0 comments
Closed

Bindings are ineffective until mode is changed #7

oscarfv opened this issue Mar 19, 2013 · 0 comments

Comments

@oscarfv
Copy link

oscarfv commented Mar 19, 2013

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:

  1. Visit a Lisp file
  2. Activate paredit-mode, if necessary
  3. Activate evil-paredit-mode, if necessary
  4. Put the cursor over a parenthesis.
  5. 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:

http://article.gmane.org/gmane.emacs.vim-emulation/1815

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

No branches or pull requests

1 participant