Skip to content

Commit 3dacecc

Browse files
committed
compact show for operators
1 parent 373cbb6 commit 3dacecc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Extras/show.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,19 @@ end
182182

183183
## Operator
184184

185-
summary(B::Operator) =
186-
string(typeof(B).name.name)*" : "*string(domainspace(B))*""*string(rangespace(B))
185+
function summary(io::IO, B::Operator)
186+
s = string(typeof(B).name.name)*" : "*string(domainspace(B))*""*string(rangespace(B))
187+
print(io, s)
188+
end
187189

188190
struct PrintShow
189191
str
190192
end
191193
Base.show(io::IO,N::PrintShow) = print(io,N.str)
192194

195+
show(io::IO, B::Operator) = summary(io, B)
193196

194-
function show(io::IO,B::Operator;header::Bool=true)
197+
function show(io::IO, ::MIME"text/plain", B::Operator;header::Bool=true)
195198
header && println(io,summary(B))
196199
dsp=domainspace(B)
197200

0 commit comments

Comments
 (0)