smartparens
smartparens copied to clipboard
Unwanted space after slurping
I just started learning Smartparens via Spacemacs and ran into this issue. On the form (let [] x {:a 1 :b 2})
, with the point at ]
, I type SPC k 2 s
(slurp 2 forms forward) to get (let [ x {:a 1 :b 2}])
. I do not expect a space between [
and x
in the final form. Is this intended behaviour?
You can call sp-backward-up-sexp
to reformat the sexp to kill any extra whitespace. Slurping itself doesn't do this but it can be implemented with a post-slurp hook. I think it would make sense in lispy languages to do that.
+1 on this. The extra space is just noise in lisp.
This is not a high priority for me currently because I never slurp into empty forms, I prefer to use wrapping which is faster. If anyone wants to provide a hook for the default config I'll happily merge it.
I see, that actually makes sense :) Found the spacemacs binding so I'm fine. Thanks @Fuco1 !