Skip to content

Commit

Permalink
make compact type alias output more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jan 20, 2021
1 parent 4e6a3a4 commit 2ee7231
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -748,22 +748,17 @@ function show_unionaliases(io::IO, x::Union)
end

function show(io::IO, ::MIME"text/plain", @nospecialize(x::Type))
show(io, x)
if !print_without_params(x) && get(io, :compact, true)
if !print_without_params(x)
properx = makeproper(io, x)
if make_typealias(properx) !== nothing || x <: make_typealiases(properx)[2]
print(io, " (alias for ")
show(IOContext(io, :compact => false), x)
print(io, ")")
show(IOContext(io, :compact => true), x)
if !(get(io, :compact, false)::Bool)
print(io, " (alias for ", x, ")")
end
return
end
end

#s1 = sprint(show, x, context = io)
#s2 = sprint(show, x, context = IOContext(io, :compact => false))
#print(io, s1)
#if s1 != s2
# print(io, " = ", s2)
#end
show(io, x)
end

function show(io::IO, @nospecialize(x::Type))
Expand Down

0 comments on commit 2ee7231

Please sign in to comment.