Handbook
Glossary
do-string-limit ( str -- trimmed )
Vocabulary
prettyprint
.
backend
Inputs
str
a
string
Outputs
trimmed
a possibly trimmed string
Word description
If
string-limit?
is on, trims the string such that it does not exceed the margin, appending "..." if trimming took place.
Definition
USING:
kernel
math
namespaces
prettyprint.config
sequences
;
IN:
prettyprint.backend
:
do-string-limit
( str -- trimmed )
string-limit?
get
[
dup
length
margin
get
>
[
margin
get
3
-
head
"..."
append
]
when
]
when
;