Skip to content

Commit

Permalink
correctly overload show instead of print
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Sep 14, 2020
1 parent 4e673f7 commit 29d5641
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/crayon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Base.print(io::IO, x::Crayon)
end
end

function Base.show(io::IO, x::Crayon)
function Base.show(io::IO, ::MIME"text/plain", x::Crayon)
if anyactive(x)
print(io, x)
print(io, ESCAPED_CSI)
Expand Down
2 changes: 1 addition & 1 deletion src/crayon_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

Base.show(io::IO, cw::CrayonWrapper) = _show(io, cw, CrayonStack(incremental = true))

_show(io::IO, str::String, stack::CrayonStack) = print(io, str)
_show(io::IO, str::String, stack::CrayonStack) = show(io, str)

function _show(io::IO, cw::CrayonWrapper, stack::CrayonStack)
print(io, push!(stack, cw.c))
Expand Down

0 comments on commit 29d5641

Please sign in to comment.