@@ -1585,11 +1585,11 @@ function print_matrix(io::IO, X::AbstractVecOrMat,
1585
1585
print (io, i == first (rowsA) ? pre : presp)
1586
1586
print_matrix_row (io, X,A,i,colsA,sep)
1587
1587
print (io, i == last (rowsA) ? post : postsp)
1588
- if i != rowsA[end ]; println (io); end
1588
+ if i != rowsA[end ] || i == rowsA[halfheight] ; println (io); end
1589
1589
if i == rowsA[halfheight]
1590
1590
print (io, i == first (rowsA) ? pre : presp)
1591
1591
print_matrix_vdots (io, vdots,A,sep,vmod,1 )
1592
- println (io, i == last (rowsA) ? post : postsp)
1592
+ print (io, i == last (rowsA) ? post : postsp * ' \n ' )
1593
1593
end
1594
1594
end
1595
1595
else # neither rows nor cols fit, so use all 3 kinds of dots
@@ -1604,16 +1604,22 @@ function print_matrix(io::IO, X::AbstractVecOrMat,
1604
1604
print (io, (i - first (rowsA)) % hmod == 0 ? hdots : repeat (" " , length (hdots)))
1605
1605
print_matrix_row (io, X,Ralign,i,n- length (Ralign)+ colsA,sep)
1606
1606
print (io, i == last (rowsA) ? post : postsp)
1607
- if i != rowsA[end ]; println (io); end
1607
+ if i != rowsA[end ] || i == rowsA[halfheight] ; println (io); end
1608
1608
if i == rowsA[halfheight]
1609
1609
print (io, i == first (rowsA) ? pre : presp)
1610
1610
print_matrix_vdots (io, vdots,Lalign,sep,vmod,1 )
1611
1611
print (io, ddots)
1612
1612
print_matrix_vdots (io, vdots,Ralign,sep,vmod,r)
1613
- println (io, i == last (rowsA) ? post : postsp)
1613
+ print (io, i == last (rowsA) ? post : postsp * ' \n ' )
1614
1614
end
1615
1615
end
1616
1616
end
1617
+ if isempty (rowsA)
1618
+ print (io, pre)
1619
+ print (io, vdots)
1620
+ length (colsA) > 1 && print (io, " " , ddots)
1621
+ print (io, post)
1622
+ end
1617
1623
end
1618
1624
end
1619
1625
@@ -1760,7 +1766,14 @@ function showarray(io::IO, X::AbstractArray, repr::Bool = true; header = true)
1760
1766
end
1761
1767
(! repr && header) && print (io, summary (X))
1762
1768
if ! isempty (X)
1763
- (! repr && header) && println (io, " :" )
1769
+ if ! repr && header
1770
+ print (io, " :" )
1771
+ if get (io, :limit , false ) && displaysize (io)[1 ]- 4 <= 0
1772
+ return print (io, " …" )
1773
+ else
1774
+ println (io)
1775
+ end
1776
+ end
1764
1777
if ndims (X) == 0
1765
1778
if isassigned (X)
1766
1779
return show (io, X[])
0 commit comments