Skip to content

Commit 47c2c4a

Browse files
[format] Fix cider-format when options are present
1 parent 6289002 commit 47c2c4a

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

cider-client.el

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -265,23 +265,17 @@ you need to encode it as the following plist:
265265
If non-nil, FORMAT-OPTIONS specifies the options cljfmt will use to format
266266
the code. See `cider-format-code-options' for details."
267267
(when format-options
268-
(let* ((indents-dict (when (assoc "indents" format-options)
269-
(thread-last
270-
(cadr (assoc "indents" format-options))
271-
(map-pairs)
272-
(seq-mapcat #'identity)
273-
(apply #'nrepl-dict))))
274-
(alias-map-dict (when (assoc "alias-map" format-options)
275-
(thread-last
276-
(cadr (assoc "alias-map" format-options))
277-
(map-pairs)
278-
(seq-mapcat #'identity)
279-
(apply #'nrepl-dict)))))
280-
(nrepl-dict
281-
`(,@(when indents-dict
282-
`("indents" ,indents-dict))
283-
,@(when alias-map-dict
284-
`("alias-map" ,alias-map-dict)))))))
268+
(let* ((indents (cadr (assoc "indents" format-options)))
269+
(alias-map (cadr (assoc "alias-map" format-options))))
270+
(apply #'nrepl-dict
271+
`(,@(when indents
272+
`("indents" ,(thread-last indents
273+
(seq-mapcat #'identity)
274+
(apply #'nrepl-dict))))
275+
,@(when alias-map
276+
`("alias-map" ,(thread-last alias-map
277+
(seq-mapcat #'identity)
278+
(apply #'nrepl-dict)))))))))
285279

286280
(defcustom cider-print-fn 'pprint
287281
"Sets the function to use for printing.

0 commit comments

Comments
 (0)