Skip to content

Commit c144736

Browse files
authored
fix Crayon breakage (#304)
1 parent 53a690a commit c144736

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/printing.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@ set_highlight(opt::HighlightOption) = _syntax_highlighting[] = opt
200200

201201
function Format.render(io::IO, ::MIME"text/ansi-debugger", tokens::Format.TokenIterator)
202202
for (str, id, style) in tokens
203-
fg = style.fg.active ? map(Int, (style.fg.r, style.fg.g, style.fg.b)) : :nothing
204-
bg = style.bg.active ? map(Int, (style.bg.r, style.bg.g, style.bg.b)) : :nothing
203+
fg = style.fg.active ? map(Int, (style.fg.r, style.fg.g, style.fg.b)) : nothing
204+
bg = style.bg.active ? map(Int, (style.bg.r, style.bg.g, style.bg.b)) : nothing
205205
crayon = Crayon(
206206
foreground = fg,
207207
background = bg,
208-
bold = style.bold ? true : :nothing,
209-
italics = style.italic ? true : :nothing,
210-
underline = style.underline ? true : :nothing,
208+
bold = style.bold ? true : nothing,
209+
italics = style.italic ? true : nothing,
210+
underline = style.underline ? true : nothing,
211211
)
212212
if _syntax_highlighting[] == HIGHLIGHT_256_COLORS
213213
crayon = Crayons.to_256_colors(crayon)
@@ -223,6 +223,7 @@ function highlight_code(code; context=nothing)
223223
try
224224
sprint(highlight, MIME("text/ansi-debugger"), code, Lexers.JuliaLexer, _current_theme[]; context=context)
225225
catch e
226+
rethrow()
226227
printstyled(stderr, "failed to highlight code, $e\n"; color=Base.warn_color())
227228
return code
228229
end

0 commit comments

Comments
 (0)