diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index 1d03707e67..fc3c66de9f 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -197,7 +197,7 @@ M: tuple pprint* : do-length-limit ( seq -- trimmed n/f ) length-limit get dup [ over length over [-] - [ drop f ] [ [ head-slice ] dip ] if-zero + dup 1 > [ [ head-slice ] dip ] [ 2drop f ] if ] when ; : pprint-elements ( seq -- ) diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 17cedcc7e4..471fba7026 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -465,7 +465,12 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ; with-string-writer ] unit-test -{ "{ 0 1 2 3 4 ~1 more~ }" } [ +{ "{ 0 1 2 3 4 5 }" } [ [ 5 length-limit [ 6 iota >array pprint ] with-variable ] with-string-writer ] unit-test + +{ "{ 0 1 2 3 4 ~2 more~ }" } [ + [ 5 length-limit [ 7 iota >array pprint ] with-variable ] + with-string-writer +] unit-test