Skip to content

Commit

Permalink
fix dislplay of empty named tuples to close #846
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Jan 26, 2023
1 parent 0215780 commit cba51a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/show.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## REGISTERING LABELS OF OBJECTS DURING ASSIGNMENT

"""
color_on()
Expand All @@ -20,6 +18,8 @@ macro colon(p)
Expr(:quote, p)
end

## REGISTERING LABELS OF OBJECTS DURING ASSIGNMENT

"""
@constant x = value
Expand Down Expand Up @@ -70,8 +70,9 @@ end

# long version of showing a named tuple:
Base.show(stream::IO, ::MIME"text/plain", t::NamedTuple) = fancy_nt(stream, t)
fancy_nt(t) = fancy_nt(stdout, t)
fancy_nt(stream::IO, t) = fancy_nt(stream, t, 0)
fancy_nt(t) = fancy_nt(stdout, t) # is this used?
fancy_nt(stream, t::NamedTuple{(), Tuple{}}) = print(stream, "NamedTuple()")
fancy_nt(stream, t) = fancy_nt(stream, t, 0)
fancy_nt(stream, t, n) = show(stream, t)
function fancy_nt(stream, t::NamedTuple, n)
print(stream, "(")
Expand Down

0 comments on commit cba51a3

Please sign in to comment.