emacs-evil/evil-surround

No surrounding delimiters found in simple parenthesis case

Closed this issue · 8 comments

Hi,

I am setting my emacs to text-mode for this because I heard there are some issues with other major modes sometimes.

when I have a simple thing like this:

(abc)

and I put point inside the parenthesis, say on b for example, then I press ds( it says "No surrounding delimiters found" in the minibuffer.

I noticed that when I have

abc

for example, put point on b and press ysiw( it inserts parenthesis like this:

( abc )

And with this, ds( works.

It's as if it notices my (-Keypress as ( (with the space after it) instead of (

Hi @Schievel1 I remember this was a bug for a while, but as I can't reproduce it now, I wonder if you're on a slightly older version of evil-surround?

Probably yes, I am using it from doom emacs and they usually pin packages to certain commits.
Since I am on the newest doom emacs I guess this is the commit I am using: da05c60

https://github.com/doomemacs/doomemacs/blob/da3d0687c5008edbbe5575ac1077798553549a6a/modules/editor/evil/packages.el#L17

Ah, in that case you are on a recent enough version. I'm a bit stumped in that case.

By the way, the ysiw( behaviour is expected. You can either do ysiw) instead or you can update the pairs alist:

(push (cons ?\( (cons "(" ")")) evil-surround-pairs-alist)

Ah, it looks like evil-embrace is used by doom as well, so maybe check with that disabled / not loaded?

You say ysiw( inserting spaces is expected behavior.
So is ds( want to delete ( + ) parethesis (with spaces). Isn't it expected behavior as well, that it can't find ( in (abc) (for the lack of spaces)?
Or is it supposed to actually notice that and delete the parenthesis even though the spaces are missing?

Yeah, it's supposed to be asymmetrical. So using ( for adding parens gives you spaces too, but using ( for deleting parens is tolerant of either parens with spaces or parens without.

Just installed evil-embrace to test this. It is causing the bug. I suggest a bug report there.

Yes I noticed that as well. Thanks for the quick help.