Fork me on GitHub
#cursive
<
2021-07-11
>
genekim00:07:28

Hello! I’m using Cursive for Fulcro, and I’m getting unexpected indentation behavior… when first argument is on a separate line, it’s fine. But when it’s on the same line, indentation is far more than expected. Any thoughts? (I was pairing with @tony.kay, and he was surprised as well — I’m assuming that this means he didn’t see this behavior on his system.). Thanks in advance!

polymeris00:07:15

You can "teach" cursive how to indent stuff. With the cursor on top of dom/div, open the "intention actions" context menu (Alt-Enter on linux, not sure on other OSs), select "Configure indentation for dom/div...", and pick "Indent".

polymeris00:07:16

Cursive should then remember how to indent that symbol, it's stored in the CodeStyle, I think. That said, sometimes I have to do that again after a while.

potetm00:07:39

@U6VPZS1EK That’s the proper indentation. The rule is: All parameters to a function are aligned vertically. Since you put the first parameter on a new line, it gets the normal 2 space indentation, and all other parameters are alighted vertically beneath it.

potetm01:07:41

You can override this behavior like polymeris says.

genekim01:07:28

Awesome! Thank you, all!!!

thheller06:07:58

in the Cursive settings Editor -> Code Style -> Clojure -> General you can set "Default To Only Indent". that IMHO is a better default and does what you wanted as a default, which you can still override for the exceptions if you want any.

💯 2
2
genekim06:07:04

Oh, that’s lovely, @U05224H0W! Thank you! (And loving all you’re doing with shadow-cljs, too! 🙂

❤️ 5