This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-18
Channels
- # announcements (19)
- # babashka (30)
- # beginners (51)
- # biff (12)
- # calva (20)
- # cider (27)
- # clara (16)
- # clj-kondo (19)
- # clojure (128)
- # clojure-canada (1)
- # clojure-dev (5)
- # clojure-europe (29)
- # clojure-nl (1)
- # clojure-norway (48)
- # clojure-uk (5)
- # clojurescript (6)
- # clr (37)
- # core-async (17)
- # cursive (2)
- # data-oriented-programming (2)
- # datahike (1)
- # datomic (5)
- # emacs (22)
- # exercism (1)
- # funcool (17)
- # humbleui (15)
- # jobs (1)
- # malli (44)
- # off-topic (11)
- # podcasts (1)
- # pomegranate (1)
- # react (1)
- # remote-jobs (1)
- # shadow-cljs (25)
- # tools-build (12)
- # tools-deps (70)
- # xtdb (24)
This is a somewhat trivial concern, but what are y'all doing to get good indentation with HumbleUI? I'm using Emacs, but I'm interested to hear what folks on VSCode or Intellij do too.
Technically no, but I noticed a disconnect between the clojure-mode default indentation for functions and the preferred indentation for HumbleUI.
(ui/dynamic ctx [{:keys [leading]} ctx]
(ui/rect (paint/fill 0xFFB2D7FE)
(ui/center (ui/padding 10 leading)
(ui/label text))))
Is the default behavior I'm seeing, but the docs look more like
(ui/dynamic ctx [{:keys [leading]} ctx]
(ui/rect (paint/fill 0xFFB2D7FE)
(ui/center (ui/padding 10 leading)
(ui/label text))))
I can technically fix it with define-clojure-indent
but that seems fragile since it's based on symbols and not associated with the var
That’s probably because dynamic is a macro and per bbatsov style macros indent content by first arg
described here https://tonsky.me/blog/clojurefmt/
Do other ui elements have multiple args? It's more the multiple args rather than the macro behavior, I think
I've read that before 😉
Pretty much all my Clojure is for personal stuff, so I tend to use whatever the Emacs defaults are
Yeah you might be right, it’s first arg by default and some macros make an exception to that
I've managed not to have real-world issues with define-clojure-indent
in both Rum and Fulcro, so maybe it's a moot point.