diff --git a/src/Dimensions/show.jl b/src/Dimensions/show.jl index e7de881a5..fc8b2039b 100644 --- a/src/Dimensions/show.jl +++ b/src/Dimensions/show.jl @@ -118,9 +118,10 @@ function print_dimval(io, mime, val, nchars=0) val isa Colon || print(io, " ") printstyled(io, val; color=get(io, :dimcolor, 1)) end -function print_dimval(io, mime, lookup::AbstractArray, nchars=0) +print_dimval(io, mime, lookup::AbstractArray, nchars=0) = Lookups.print_index(io, mime, lookup, nchars) -end +print_dimval(io, mime, lookup::AbstractArray{<:Any,0}, nchars=0) = + printstyled(io, " ", lookup; color=get(io, :dimcolor, 1)) print_dimval(io, mime, lookup::Union{AutoLookup,AbstractNoLookup}, nchars=0) = print(io, "") function print_dimval(io, mime, lookup::Lookup, nchars=0) print(io, " ") diff --git a/test/show.jl b/test/show.jl index 40a7aa2d0..2a2df0a98 100644 --- a/test/show.jl +++ b/test/show.jl @@ -63,6 +63,10 @@ end @testset "dims" begin sv = sprint(show, MIME("text/plain"), X()) @test occursin("X", sv) + sv = sprint(show, MIME("text/plain"), X(fill(0))) + @test occursin("X", sv) + sv = sprint(show, MIME("text/plain"), X(1:5)) + @test occursin("X", sv) end @testset "show lookups" begin