chat-cli: print newlines correctly

By accounting for them during text wrapping, instead of letting them
fall through to the printer.
This commit is contained in:
Fang 2020-05-15 14:10:07 +02:00
parent ccb994a6d3
commit 7e06e02587
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -1538,6 +1538,8 @@
^- (list tape)
?~ txt ~
=/ [end=@ud nex=?]
=+ ret=(find "\0a" (scag +(wid) `tape`txt))
?^ ret [u.ret &]
?: (lte (lent txt) wid) [(lent txt) &]
=+ ace=(find " " (flop (scag +(wid) `tape`txt)))
?~ ace [wid |]