Fork me on GitHub
#spacemacs
<
2023-02-06
>
Black17:02:14

Question about Evil Cleverparens safe structural editing Example code:

(fn [a b]
  (fn-with a)
  (fn-with b))
So if I delete last line with d d then closing parens is moved to line above as expected. But when I just need to comment out last line, using SPC ; ; result is unbalanced code:
(fn [a b]
  (fn-with a)
  ;; (fn-with b))
Is there any solution for this?

tomd17:02:07

(sorry I don't use spacemacs, but I have notifications for evil as the maintainer) - what function is SPC ; ; calling? As evil-cleverparens doesn't do commenting-out, I assume it's a lib like evil-comentary or evil-nerd-commenter which may be to blame.

Black17:02:15

evilnc-comment-operator I guess?

tomd17:02:48

yeah, so I just checked, evil-nerd-commenter doesn't do "structural commenting"

tomd17:02:12

I don't maintain either, but I do maintain evil-cleverparens. I could have a think about whether it should intercept/override evil-commentary and evil-nerd-commenter to add structural sensitivity, or even just provide bindings of it's own :thinking_face:

tomd17:02:30

If you have any thoughts, feel free to leave an issue on the evil-cleverparens github issue page

tomd17:02:31

Right now, with the cursor in (fn-with b) you can probably do SPC ; a( to achieve what you want

👍 2
2