@@ -254,15 +254,27 @@ paramname(p::AbstractArray) = string(p)
254254paramname (p:: Nothing ) = repr (p)
255255paramname (p) = nameof (typeof (p))
256256
257+ # Credit to Sebastian Pfitzner
258+ function printlimited (io, x; Δx = 0 , Δy = 0 )
259+ sz = displaysize (io)
260+ io2 = IOBuffer (); ctx = IOContext (io2, :limit => true , :compact => true ,
261+ :displaysize => (sz[1 ]- Δy, sz[2 ]- Δx))
262+ Base. print_array (ctx, x)
263+ s = String (take! (io2))
264+ s = replace (s[2 : end ], " " => " , " )
265+ Base. print (io, " [" * s* " ]" )
266+ end
267+
257268function Base. show (io:: IO , ds:: DS )
258269 ps = 14
259270 text = summary (ds)
260- u0 = get_state (ds)
271+ u0 = get_state (ds)'
261272
262273 ctx = IOContext (io, :limit => true , :compact => true , :displaysize => (10 ,50 ))
263274
264- print (io, text* " \n " )
265- println (ctx, rpad (" state: " , ps), get_state (ds))
275+ println (io, text)
276+ prefix = rpad (" state: " , ps)
277+ print (io, prefix); printlimited (io, u0, Δx = length (prefix)); println ()
266278 println (io, rpad (" e.o.m.: " , ps), eomstring (ds. f))
267279 println (io, rpad (" in-place? " , ps), isinplace (ds))
268280 println (io, rpad (" jacobian: " , ps), jacobianstring (ds)),
0 commit comments