aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/wrap/wrap.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/wrap/wrap.tm b/examples/wrap/wrap.tm
index ced8aab1..1c43470a 100644
--- a/examples/wrap/wrap.tm
+++ b/examples/wrap/wrap.tm
@@ -49,12 +49,12 @@ func wrap(text:Text, width:Int, min_split=3, hyphen="-" -> Text):
split = split _max_ min_split
split = split _min_ (letters.length - min_split)
if line != "": line ++= " "
- line ++= ((++) letters:to(split)) ++ hyphen
+ line ++= ((++: letters:to(split)) or "") ++ hyphen
letters = letters:from(split + 1)
else if line == "":
# Force split word without hyphenation:
if line != "": line ++= " "
- line ++= ((++) letters:to(line_space))
+ line ++= (++: letters:to(line_space)) or ""
letters = letters:from(line_space + 1)
else:
pass # Move to next line
@@ -64,7 +64,7 @@ func wrap(text:Text, width:Int, min_split=3, hyphen="-" -> Text):
if letters.length > 0:
if line != "": line ++= " "
- line ++= (++) letters
+ line ++= (++: letters) or ""
if line != "":
lines:insert(line)