]> gitweb.factorcode.org Git - factor.git/commitdiff
prettyprint: fix length limit to be 'maximum length before truncation'.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Mar 2013 22:30:29 +0000 (15:30 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Mar 2013 22:30:29 +0000 (15:30 -0700)
basis/prettyprint/backend/backend.factor
basis/prettyprint/prettyprint-tests.factor

index fc3c66de9f84c9c2fd135df775869778618315ed..ec76a79d3c2d07add3283bf908a60f82f00c3b58 100644 (file)
@@ -196,7 +196,7 @@ M: tuple pprint*
 
 : do-length-limit ( seq -- trimmed n/f )
     length-limit get dup [
-        over length over [-]
+        1 - over length over [-]
         dup 1 > [ [ head-slice ] dip ] [ 2drop f ] if
     ] when ;
 
index 471fba702627afb40cd9efc95696bd08adba2d49..5efebc3aac044431c436ba6fad7d19d90aaa6733 100644 (file)
@@ -465,12 +465,7 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ;
     with-string-writer
 ] unit-test
 
-{ "{ 0 1 2 3 4 5 }" } [
+{ "{ 0 1 2 3 ~2 more~ }" } [
     [ 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