Improve rendering of multi-line %exp messages in talk

This commit is contained in:
Fang 2019-07-31 13:41:07 +02:00
parent 3e028fde21
commit 470a22cae4
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -2314,7 +2314,15 @@
url+(crip (apix:en-purl:html url.sep))
::
$exp
mor+~[txt+"# {(trip exp.sep)}" tan+res.sep]
=/ texp=tape ['>' ' ' (trip exp.sep)]
:- %mor
|- ^- (list sole-effect:sole-sur)
?: =("" texp) [tan+res.sep ~]
=/ newl (find "\0a" texp)
?~ newl [txt+texp $(texp "")]
=+ (trim u.newl texp)
:- txt+(scag u.newl texp)
$(texp [' ' ' ' (slag +(u.newl) texp)])
::
$ire
=+ num=(~(get by known) top.sep)
@ -2399,7 +2407,11 @@
==
::
$exp
:- (tr-chow wyd '#' ' ' (trip exp.sep))
=+ texp=(trip exp.sep)
=+ newline=(find "\0a" texp)
=? texp ?=(^ newline)
(weld (scag u.newline texp) " ...")
:- (tr-chow wyd '#' ' ' texp)
?~ res.sep ~
=- [' ' (tr-chow (dec wyd) ' ' -)]~
~(ram re (snag 0 `(list tank)`res.sep))