-
Notifications
You must be signed in to change notification settings - Fork 35
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
Slightly wrong behavior for evil-cp-forward-sexp and evil-cp-backward-sexp at end of line #29
Comments
I can't reproduce this. I use |
Really? I'll try later this week to reproduce it with a minimal config |
I believe |
Oh, that's true but it also depends on the value of |
Ok, I've got a reproduction recipe. I've noticed that if The recipe:
(add-to-list 'load-path "/path/to/evil/")
(add-to-list 'load-path "/path/to/goto-chg/")
(add-to-list 'load-path "/path/to/undo-tree/")
(require 'evil)
(evil-mode +1)
(add-to-list 'load-path "/path/to/evil-cleverparens/")
(add-to-list 'load-path "/path/to/dash/")
(add-to-list 'load-path "/path/to/smartparens/")
(add-to-list 'load-path "/path/to/paredit/")
(require 'evil-cleverparens)
|
Thanks for the reproduction steps, I can see what the problem is now. With I've personally always used evil with |
Here are some ideas:
Something like: (evil-define-motion evil-cp-end-of-defun (count)
"Motion for moving forward by a sexp via `sp-forward-sexp'."
:type exclusive
(let ((count (or count 1)))
(sp-forward-sexp count)
(when (and evil-move-cursor-back (not evil-move-beyond-eol) (eolp))
(forward-char 1))))
|
I patched this in my config with:
There is an open issue on smartparens Fuco1/smartparens#1037 which is where it should probably be fixed but I'm not sure how much they care about fixing evil mode edge cases. I think evil-cleverparens could fix it by just adding:
before calling |
It seems that first hacky advice-add before |
Nice! I'll take a look soon and can make the change if it looks good |
Added the fix suggested by @bo-tato to master, so |
Hey, first of all thanks for this package, I think it's great.
I noticed a slightly annoying behavior for
evil-cp-forward-sexp
andevil-cp-backward-sexp
(L and H). Consider this elisp file (|
denotes the cursor):If
evil-move-beyond-eol
ist
, then pressing L once moves the cursor after "bbb)":From here, I can press either L or H. If I press L:
Or if I press H:
Which is exactly what I expect to happen, so I consider it a good behavior.
On the other hand, if
evil-move-beyond-eol
isnil
, the behavior is a bit off. Starting from the same place as before:Pressing L once moves the cursor after "bbb" but before the ")". Because
evil-move-beyond-eol
isnil
, this is the expected behavior (so far so good).From here, however, pressing either L or H doesn't bring me to where I want. If I press L, the cursor doesn't move at all.
If I press H, the cursor moves in front of "bbb" instead of returning to where it was:
The two problems here are that in this case H doesn't do the reverse of L, and that I can't move forward in the list because of how evil-mode adjusts the cursor.
Will it be possible to modify
evil-cp-forward-sexp
andevil-cp-backward-sexp
for the case where the cursor is on a closing paren andevil-move-beyond-eol
isnil
? If not,The text was updated successfully, but these errors were encountered: