smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Unwanted space after slurping

Open crinklywrappr opened this issue 9 years ago • 4 comments

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?

crinklywrappr avatar Jun 22 '15 03:06 crinklywrappr

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.

Fuco1 avatar Jun 28 '15 21:06 Fuco1

+1 on this. The extra space is just noise in lisp.

xificurC avatar Sep 23 '15 14:09 xificurC

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.

Fuco1 avatar Sep 23 '15 15:09 Fuco1

I see, that actually makes sense :) Found the spacemacs binding so I'm fine. Thanks @Fuco1 !

xificurC avatar Sep 23 '15 19:09 xificurC