Closed dieggsy closed 1 year ago
Oh I see, I called evil-surround-delete-manually
to test. Do the parens have have spaces for (
to work? Has this always been the case?
After a bit more debugging, this appears to be an issue with evil-embrace. When I don't load that package this works as expected.
Turns out I'm not actually sure I need embrace at all (and therefore probably don't need evil-embrace), but for posterity or anyone searching for this issue:
I'm really not a fan of how evil-embrace is coded. It seems to copy all of the source code of evil-surround functions with minor changes and override them, as opposed to minimally advising them (which is why it got out of sync, and it appears it's happened before). I found if I wanted I could achieve most of the desired effect with just the following:
(use-package embrace
:after evil-surround
:config
(define-advice evil-surround-region (:around (fn beg end type char &optional force-new-line) d/embrace)
(if (evil-surround--get-delims char)
(funcall fn beg end type char force-new-line)
(embrace--add-internal beg end char)))
(define-advice evil-surround-delete (:around (fn char &optional outer inner) d/embrace)
(if (or (and outer inner)
(evil-surround--get-delims char))
(funcall fn char outer inner)
(embrace--delete char))))
This seems similar to #204, but I'm not using evil-cleverparens.
I'm just trying to delete the surrounding pair using
(
, and I get:Using
)
works. I'm not entirely sure how to debug this.