Skip to content

Commit

Permalink
Use line breaks between map keys and collection values.
Browse files Browse the repository at this point in the history
  • Loading branch information
greglook committed May 27, 2014
1 parent 60c4188 commit a20728a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/puget/printer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,18 @@

(defn- canonize-map
[m]
(let [canonize-kv (fn [[k v]] [:span (canonize k) " " (canonize v)])
entries (->> (seq m) (sort-by first order/rank) (map canonize-kv))]
(let [canonize-kv
(fn [[k v]]
[:span
(canonize k)
(cond
(satisfies? data/TaggedValue v) " "
(coll? v) :line
:else " ")
(canonize v)])
entries (->> (seq m)
(sort-by first order/rank)
(map canonize-kv))]
[:group
(color-doc :delimiter "{")
[:align (interpose [:span *map-delimiter* :line] entries)]
Expand Down

0 comments on commit a20728a

Please sign in to comment.