|
729 | 729 |
|
730 | 730 | (defmethod inspect :nil [inspector _obj]
|
731 | 731 | (-> inspector
|
732 |
| - (render-ln "nil"))) |
| 732 | + (render-ln "Value: nil") |
| 733 | + (render-section-header "Contents") |
| 734 | + (indent) |
| 735 | + (render-indent-ln |
| 736 | + (rand-nth ["You have gazed into the void and it winked back." |
| 737 | + "You've reached the end of the universe. Time to turn back." |
| 738 | + "There's nothing here… or is there? Nope. Still nothing." |
| 739 | + "Welcome to Nil. Population: 0." |
| 740 | + "I sometimes come here too, to enjoy the peace and quiet." |
| 741 | + "Here lies no data. Rest in peace, little bytes." |
| 742 | + "Warning: staring too long at nil may summon cosmic horrors." |
| 743 | + "This whole trip might have been for nothing! Zero, zilch, zip, nada, nothing." |
| 744 | + "No data found. Please insert meaning manually."])) |
| 745 | + (unindent))) |
733 | 746 |
|
734 | 747 | (defn- inspect-coll [inspector obj]
|
735 | 748 | (-> (render-class-name inspector obj)
|
|
1035 | 1048 | (if (and (seq path) (not-any? #(= % '<unknown>) path))
|
1036 | 1049 | (-> (render-section-header inspector "Path")
|
1037 | 1050 | (indent)
|
1038 |
| - (render-indent (str/join " " (:path inspector))) |
| 1051 | + (render-indent-ln (str/join " " (:path inspector))) |
1039 | 1052 | (unindent))
|
1040 | 1053 | inspector)))
|
1041 | 1054 |
|
1042 |
| -(defn render-view-mode [inspector] |
1043 |
| - (let [{:keys [view-mode pretty-print]} inspector |
1044 |
| - supported (filter #(view-mode-supported? inspector %) view-mode-order) |
1045 |
| - add-circle #(if %2 (str "●" %1) %1) |
1046 |
| - view-mode-str (str (->> supported |
1047 |
| - (map #(add-circle (name %) (= % view-mode))) |
1048 |
| - (str/join " ")) |
1049 |
| - " " (add-circle "pretty" pretty-print))] |
1050 |
| - (-> (render-section-header inspector "View mode (press 'v' to cycle, 'P' to pretty-print)") |
1051 |
| - (indent) |
1052 |
| - (render-indent view-mode-str) |
1053 |
| - (unindent)))) |
| 1055 | +(defn render-view-mode [{:keys [value view-mode pretty-print] :as inspector}] |
| 1056 | + (if (some? value) |
| 1057 | + (let [supported (filter #(view-mode-supported? inspector %) view-mode-order) |
| 1058 | + add-circle #(if %2 (str "●" %1) %1) |
| 1059 | + view-mode-str (str (->> supported |
| 1060 | + (map #(add-circle (name %) (= % view-mode))) |
| 1061 | + (str/join " ")) |
| 1062 | + " " (add-circle "pretty" pretty-print))] |
| 1063 | + (-> (render-section-header inspector "View mode (press 'v' to cycle, 'P' to pretty-print)") |
| 1064 | + (indent) |
| 1065 | + (render-indent view-mode-str) |
| 1066 | + (unindent))) |
| 1067 | + inspector)) |
1054 | 1068 |
|
1055 | 1069 | (defn inspect-render
|
1056 | 1070 | ([{:keys [max-atom-length max-value-length max-coll-size max-nested-depth value pretty-print]
|
|
0 commit comments