greglook / cljstyle

A tool for formatting Clojure code
Eclipse Public License 1.0
293 stars 39 forks source link

Fix indenting within function literal #1

Closed aengelberg closed 6 years ago

aengelberg commented 6 years ago

There appears to be a bug that when list-indent is called in a #(...) form, the # character isn't accounted for, making the inner forms look one space short. Note that this bug only comes into play when the inner form doesn't match any custom indent rules.

;; Before
(do
  (a-thing))
#(do
   (a-thing))
(foo
  (bar))
#(foo
  (bar))   ; <-- !!!

;; After (with my fix)
(do
  (a-thing))
#(do
   (a-thing))
(foo
  (bar))
#(foo
   (bar))