Skip to content

Commit aa21cbe

Browse files
authored
Use color for all IO's, if supported. (#257)
1 parent f1fd912 commit aa21cbe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/reflection.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ function pygmentize()
1616
return _pygmentize[]
1717
end
1818

19-
function highlight(io::Base.TTY, code, lexer)
19+
function highlight(io::IO, code, lexer)
2020
highlighter = pygmentize()
2121
have_color = get(io, :color, false)
2222
if highlighter === nothing || !have_color
2323
print(io, code)
24-
return code
2524
else
2625
custom_lexer = joinpath(dirname(@__DIR__), "res", "pygments", "$lexer.py")
2726
if isfile(custom_lexer)
@@ -33,10 +32,9 @@ function highlight(io::Base.TTY, code, lexer)
3332
close(pipe.in)
3433
print(io, read(pipe, String))
3534
end
35+
return
3636
end
3737

38-
highlight(io, code, lexer) = print(io, code)
39-
4038

4139
#
4240
# code_* replacements

0 commit comments

Comments
 (0)