Skip to content

Commit

Permalink
Fix issue #37: Add special cases to pprint-str for *print-level* and …
Browse files Browse the repository at this point in the history
…*print-length*
  • Loading branch information
jafingerhut committed May 21, 2012
1 parent bbf0db2 commit e81de94
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/clj_ns_browser/utils.clj
Expand Up @@ -477,7 +477,17 @@
(defn pprint-str (defn pprint-str
"Return string with pprint of v, and limit output to prevent blowup." "Return string with pprint of v, and limit output to prevent blowup."
([v & kvs] ([v & kvs]
(with-out-str (binding [*print-length* 32 *print-level* 6] (pprint v))))) (with-out-str
;; Special case for these Vars so that they pprint the correct
;; values. Assume that their values do not need the
;; *print-length* or *print-level* restrictions to be short.
;; Since their values are almost always integers, this is
;; usually the case.
(if (or (= v #'clojure.core/*print-length*)
(= v #'clojure.core/*print-level*))
(pprint v)
(binding [*print-length* 32 *print-level* 6]
(pprint v))))))




(defn val-kv-filter (defn val-kv-filter
Expand Down

0 comments on commit e81de94

Please sign in to comment.