Skip to content

Commit c1c63bc

Browse files
[pprint] Default to orchard.pp for missing 3rd-party pprinters
1 parent 6e0d842 commit c1c63bc

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/cider/nrepl/pprint.clj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
{:added "0.20"}
66
(:refer-clojure :exclude [pr])
77
(:require
8-
[clojure.pprint :as pp]
8+
[clojure.pprint]
9+
[orchard.pp :as pp]
910
[orchard.misc :as misc]))
1011

1112
(def ^:private pr-options
@@ -52,7 +53,13 @@
5253
([value writer]
5354
(pprint value writer {}))
5455
([value writer options]
55-
(apply pp/write value (mapcat identity (assoc options :stream writer)))))
56+
(apply clojure.pprint/write value (mapcat identity (assoc options :stream writer)))))
57+
58+
(defn orchard-pprint
59+
([value writer]
60+
(pp/pprint writer value {}))
61+
([value writer options]
62+
(pp/pprint writer value options)))
5663

5764
(def ^:private fipp-printer
5865
(delay (requiring-resolve 'fipp.edn/pprint)))
@@ -74,8 +81,8 @@
7481
(if-some [puget @puget-printer]
7582
(binding [*out* writer]
7683
(puget value options))
77-
;; Default ot clojure.pprint/pprint if Puget could not be loaded.
78-
(pprint value writer options))))
84+
;; Default to orchard.pp/pprint if Puget could not be loaded.
85+
(pp/pprint writer value options))))
7986

8087
(def ^:private zprint-printer
8188
(delay (try-resolve 'zprint.core/zprint "zprint")))
@@ -87,5 +94,5 @@
8794
(if-some [zprint @zprint-printer]
8895
(binding [*out* writer]
8996
(zprint value options))
90-
;; Default ot clojure.pprint/pprint if Zprint could not be loaded.
91-
(pprint value writer options))))
97+
;; Default to orchard.pp/pprint if Puget could not be loaded.
98+
(pp/pprint writer value options))))

0 commit comments

Comments
 (0)