aboutsummaryrefslogtreecommitdiff
path: root/src/clojure
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure')
-rw-r--r--src/clojure/contrib/pprint/PrettyWriter.clj6
-rw-r--r--src/clojure/contrib/test_contrib/pprint/pretty.clj9
2 files changed, 13 insertions, 2 deletions
diff --git a/src/clojure/contrib/pprint/PrettyWriter.clj b/src/clojure/contrib/pprint/PrettyWriter.clj
index e192898e..aef8a27f 100644
--- a/src/clojure/contrib/pprint/PrettyWriter.clj
+++ b/src/clojure/contrib/pprint/PrettyWriter.clj
@@ -146,8 +146,10 @@
(defmethod write-token :nl [#^clojure.contrib.pprint.PrettyWriter this token]
; (prlabel wt @(:done-nl (:logical-block token)))
- (if (and (not (= (:type token) :fill))
- @(:done-nl (:logical-block token)))
+; (prlabel wt (:type token) (= (:type token) :mandatory))
+ (if (or (= (:type token) :mandatory)
+ (and (not (= (:type token) :fill))
+ @(:done-nl (:logical-block token))))
(emit-nl this token)
(if-let [#^String tws (getf :trailing-white-space)]
(.col-write this tws)))
diff --git a/src/clojure/contrib/test_contrib/pprint/pretty.clj b/src/clojure/contrib/test_contrib/pprint/pretty.clj
index 89df9b24..c0cbb615 100644
--- a/src/clojure/contrib/test_contrib/pprint/pretty.clj
+++ b/src/clojure/contrib/test_contrib/pprint/pretty.clj
@@ -47,6 +47,15 @@
(cl-format nil "~:<LIST ~@_~W ~@_~W ~@_~W~:>" '(first second third)))
"(LIST first second third)")
+(simple-tests mandatory-fill-test
+ (cl-format nil
+ "<pre>~%~<Usage: ~:I~@{*~a*~^~:@_~}~:>~%</pre>~%"
+ [ "hello" "gooodbye" ])
+ "<pre>
+Usage: *hello*
+ *gooodbye*
+</pre>
+")
(simple-tests prefix-suffix-test
(binding [*print-pprint-dispatch* *simple-dispatch*