Skip to content

Commit

Permalink
Fix showing AnnotatedChar with colour
Browse files Browse the repository at this point in the history
This method was overlooked when the AnnotatedString(::String,
::Vector{Pair{Symbol, <:Any}}) constructor was removed.
  • Loading branch information
tecosaur committed Dec 28, 2023
1 parent 44f5fd7 commit 3fab35e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function show(io::IO, c::AnnotatedChar)
if get(io, :color, false) == true
out = IOBuffer()
show(out, c.char)
print(io, ''', AnnotatedString(String(take!(out)[2:end-1]), c.annotations), ''')
print(io, ''', AnnotatedString(String(take!(out)[2:end-1]), map(a -> (1:ncodeunits(c), a), c.annotations)), ''')
else
show(io, c.char)
end
Expand Down

0 comments on commit 3fab35e

Please sign in to comment.