pretty: fix printing of long strings e.g. pi.evalf(100) (#941)
When pretty needs to print long stringPicts, we see at what terminal width is,
and wraps the picture. Also currently we add vertical spacer between blocks.
For mathematical formulas with height > 1 this is certainly the right thing to
do, e.g.:
2 2 3 3 4 4
6*x *y + 4*x*y + 4*y*x + x + y
is wrapped into this:
2 2 3
6*x *y + 4*x*y +
<-- note vertical spacer
3 4 4
4*y*x + x + y
But if we'll look at pi.evalf(100), or long dict or another string which is
originally 1-character in height, it seems putting such v-spacers is not
convenient:
In [2]: pi.evalf(48) | In [2]: pi.evalf(48)
Out[2]: | Out[2]:
3.
14159265358979323 | 3.
14159265358979323
8462643383279502884 |
19716939937 |
8462643383279502884
|
|
19716939937
That's why I propose we stop adding this v-spacers if original picture is
1-character in height.
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>