Fork me on GitHub
#cursive
<
2022-12-10
>
UlisesMAC16:12:23

Hi all, Is there a way to automatically align case, cond or cond-> pairs like the pairs inside the let's vector? Thanks!

grav08:12:13

An alternative approach is to use line breaks between pairs:

(case x
  1
  "hello"

  2 
  "goodbye")

👍 1
eskos10:12:27

That IMO looks ugly, but eh, formatting is always a matter of taste... 🙂 You can tell Cursive to (re)format specific symbols as something else, see https://cursive-ide.com/userguide/formatting.html Basically, you can tell Cursive to format case/cond/cond-> as let and it'll work the same.

👍 1
UlisesMAC13:12:18

@U052XLL3A yep, when the expression is too big I usually style using what you suggested, but it's not very common. @U8SFC8HLP Have you found an expression to assign to style cond and case? Since let aligns the pairs inside the first argument (a vector), and case's first parameter is a var, I'd like to style the rest arguments that aren't inside a vector and I haven't found an expression that performs that alignment.

cfleming21:12:47

No, there isn’t a good way to do this at the moment, sorry.

🆗 1
serioga17:12:52

@U02TF2JU3M4 I use commas to align

staypufd04:12:49

Nice trick since comma’s are considered whitespace. 🙂

🙂 1