Skip to content

Commit

Permalink
Fix *print-right-margin* binding in wrap-pprint-fn
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Aug 20, 2017
1 parent d7e0c3c commit a828403
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cider/nrepl/middleware/pprint.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
(binding [*print-length* (or print-length (get @session #'*print-length*))
*print-level* (or print-level (get @session #'*print-level*))
*print-meta* (or print-meta (get @session #'*print-meta*))
*print-right-margin* (or print-right-margin (get @session #'*print-right-margin*))]
*print-right-margin* (or print-right-margin *print-right-margin*)]
((resolve-pprint-fn pprint-fn) object)))))))

(def wrap-pprint-fn-optional-arguments
Expand All @@ -92,7 +92,8 @@
;; Binding `*msg*` sets the `:id` slot when printing to an nREPL session
;; PrintWriter (as created by `pprint-writer`), which the client requires to
;; handle the response correctly.
(binding [*msg* msg *out* writer]
(binding [*msg* msg
*out* writer]
(let [value (cljs/response-value msg response)
print-fn (if (string? value) println pprint-fn)]
(print-fn value))))
Expand Down

0 comments on commit a828403

Please sign in to comment.