Skip to content

Commit

Permalink
Fix double display on Juno
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Jun 13, 2020
1 parent a23875f commit c28076c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/drawings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ current_bufferdata() = getfield(CURRENTDRAWING[1], :bufferdata)

function Base.show(io::IO, ::MIME"text/plain", d::Drawing)
returnvalue = d.filename
# When the caller of `show` wants a short description,
# we only print the filename.
if get(io, :limit, false)
print(io, returnvalue)
# IJulia and Juno call the `show` function twice: once for
# the image MIME and a second time for the text/plain MIME.
# We check if this is such a 'second call':
if (get(io, :jupyter, false) || Juno.isactive()) && (d.surfacetype == :svg || d.surfacetype == :png)
return
end
# otherwise, we open the image file
Expand Down

0 comments on commit c28076c

Please sign in to comment.