From d02658e0ba6c20f4154a97ddd8bb76e28a98184f Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 21 May 2018 15:09:50 +0200 Subject: [PATCH] add text/plain default, fix #1515 --- src/backends/hdf5.jl | 4 ---- src/backends/inspectdr.jl | 1 - src/output.jl | 6 +++--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/backends/hdf5.jl b/src/backends/hdf5.jl index 2cbe7a76..a82a277f 100644 --- a/src/backends/hdf5.jl +++ b/src/backends/hdf5.jl @@ -240,10 +240,6 @@ end # ---------------------------------------------------------------- -_show(io::IO, mime::MIME"text/plain", plt::Plot{HDF5Backend}) = nothing #Don't show - -# ---------------------------------------------------------------- - # Display/show the plot (open a GUI window, or browser page, for example). function _display(plt::Plot{HDF5Backend}) msg = "HDF5 interface does not support `display()` function." diff --git a/src/backends/inspectdr.jl b/src/backends/inspectdr.jl index d0d3e285..8cc2a22c 100644 --- a/src/backends/inspectdr.jl +++ b/src/backends/inspectdr.jl @@ -523,7 +523,6 @@ for (mime, fmt) in _inspectdr_mimeformats_nodpi _inspectdr_show(io, mime, _inspectdr_getmplot(plt.o), plt[:size]...) end end -_show(io::IO, mime::MIME"text/plain", plt::Plot{InspectDRBackend}) = nothing #Don't show # ---------------------------------------------------------------- diff --git a/src/output.jl b/src/output.jl index 3932d94b..8cb2a05c 100644 --- a/src/output.jl +++ b/src/output.jl @@ -211,6 +211,9 @@ for mime in keys(_mimeformats) end end +# default text/plain for all backends +_show(io::IO, ::MIME{Symbol("text/plain")}, plt::Plot) = show(io, plt) + "Close all open gui windows of the current backend" closeall() = closeall(backend()) @@ -322,9 +325,6 @@ end if Juno.isactive() Media.media(Plot, Media.Plot) - - _show(io::IO, m::MIME"text/plain", plt::Plot{B}) where {B} = print(io, "Plot{$B}()") - function Juno.render(e::Juno.Editor, plt::Plot) Juno.render(e, nothing) end