emacs-evil/evil-cleverparens

evil-cp-change to end of word with numeral at end of string

Closed this issue · 7 comments

From

"hello|9"

with cursor at |, pressing ce will result in:

"hello"|

leaving cursor outside the closing quote.

I am not able to reproduce this. Perhaps it might be because of some setting in evil like evil-move-cursor-back (I tried this one and still was unable to reproduce) that causes it to behave differently for us?

Hm, I'm able to reproduce it with emacs -Q, M-x package-initialize M-x evil-mode and M-x evil-cleverparens-mode and no other settings. I'm on 25.0.50.1.

e: to be clear, "cursor at |" means the normal-state cursor is over the numeral ("9").
cw works as expected, co gives the same wrong result bringing cursor out of closing quotation.

Ah you are right! Turns out I was using an outdated version of my own mode. Will investigate.

The issue appears to be more general and happens on all delimiters whenever the cursor is on top of the last letter of a word. Note that in regular evil, calling de on foo bar with point on the last o of foo leaves you with fo rather than fo bar. I do think that in evil-cleverparens what you did should probably behave the way you expected though.

Should be fixed now.

Wow, good point on that evil behavior. That is inexplicably the default in in vim as well... that seems totally inconsistent. Anyways, will test your fix, thanks.

Forgot to close :) Works perfectly