From 870131fa4114af141b4c40d8275259e5d19e444b Mon Sep 17 00:00:00 2001 From: Mauro Date: Wed, 12 Dec 2018 10:23:06 +0000 Subject: [PATCH] Compact show, fix #75 (#93) --- src/Parameters.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Parameters.jl b/src/Parameters.jl index 6853eea..e431d06 100644 --- a/src/Parameters.jl +++ b/src/Parameters.jl @@ -536,9 +536,13 @@ function with_kw(typedef, mod::Module, withshow=true) pack_name_depr = Symbol("pack_"*string(tn)) showfn = if withshow :(function Base.show(io::IO, p::$tn) + if get(io, :compact, false) || get(io, :typeinfo, nothing)==$tn + Base.show_default(IOContext(io, :limit => true), p) + else # just dumping seems to give ok output, in particular for big data-sets: dump(IOContext(io, :limit => true), p, maxdepth=1) - end) + end + end) else :nothing end