]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix to wrapcomments.py
authorTimo Heister <timo.heister@gmail.com>
Thu, 9 Jul 2015 18:29:59 +0000 (14:29 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 9 Jul 2015 20:05:03 +0000 (16:05 -0400)
contrib/utilities/wrapcomments.py

index 800166612074146bef6560b5c4acfd2265553f7d..3c18d38a22f8f899f21493ad5d703bc6ac9f5b0f 100755 (executable)
@@ -18,6 +18,7 @@ def wrap_block(lines, startwith):
     longline = " ".join(lines)
     wrapper.initial_indent = startwith
     wrapper.subsequent_indent = startwith
+    wrapper.break_long_words = False
     wrapper.width = 78
     return wrapper.wrap(longline)
 
@@ -412,6 +413,16 @@ lineI = [" /**", \
          "  */"]
 assert(format_block(lineI)==lineI)
 
+# do not break $very_long_formula_without_spacing$:
+longtext = "blabla"*20
+lineI = [" /**", \
+         "  * a $" + longtext + "$", \
+         "  */"]
+lineO = [" /**", \
+         "  * a", \
+         "  * $" + longtext + "$", \
+         "  */"]
+assert(format_block(lineI)==lineO)
 
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.