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 9ef10f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cider/nrepl/middleware/pprint.clj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
(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*))]
;; pprint/*print-right-margin* is not bound by session middleware
*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 +93,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 9ef10f2

Please sign in to comment.