From 64343fa8240cb88f6d02a0c7119f9408a717b63b Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 25 Jul 2024 19:21:59 +0800 Subject: [PATCH] Treat printing as more than a nothing-return write As raised in , once we look at AbstractString types outside of Core/Base, their print methods can be meaningfully different to write + returning nothing. As such, instead of delegating printing to write, we need to call _ansi_writer asking it to use the print function. --- src/io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io.jl b/src/io.jl index 63e8f0d5..72694367 100644 --- a/src/io.jl +++ b/src/io.jl @@ -253,7 +253,7 @@ write(io::IO, s::Union{<:AnnotatedString, SubString{<:AnnotatedString}}) = _ansi_writer(io, s, write)::Int print(io::IO, s::Union{<:AnnotatedString, SubString{<:AnnotatedString}}) = - (write(io, s); nothing) + (_ansi_writer(io, s, print); nothing) escape_string(io::IO, s::Union{<:AnnotatedString, SubString{<:AnnotatedString}}, esc = ""; keep = ()) =