prettyprint: Don't print ~1 more~ when there is only one element left. Fixes #524.
parent
eb136e0f21
commit
5291eec130
|
@ -197,7 +197,7 @@ M: tuple pprint*
|
||||||
: do-length-limit ( seq -- trimmed n/f )
|
: do-length-limit ( seq -- trimmed n/f )
|
||||||
length-limit get dup [
|
length-limit get dup [
|
||||||
over length over [-]
|
over length over [-]
|
||||||
[ drop f ] [ [ head-slice ] dip ] if-zero
|
dup 1 > [ [ head-slice ] dip ] [ 2drop f ] if
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: pprint-elements ( seq -- )
|
: pprint-elements ( seq -- )
|
||||||
|
|
|
@ -465,7 +465,12 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ;
|
||||||
with-string-writer
|
with-string-writer
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
{ "{ 0 1 2 3 4 ~1 more~ }" } [
|
{ "{ 0 1 2 3 4 5 }" } [
|
||||||
[ 5 length-limit [ 6 iota >array pprint ] with-variable ]
|
[ 5 length-limit [ 6 iota >array pprint ] with-variable ]
|
||||||
with-string-writer
|
with-string-writer
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
{ "{ 0 1 2 3 4 ~2 more~ }" } [
|
||||||
|
[ 5 length-limit [ 7 iota >array pprint ] with-variable ]
|
||||||
|
with-string-writer
|
||||||
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue