Optimise inspect coloring (#69)

This commit is contained in:
Jonatan Kłosko 2021-03-04 11:22:03 +01:00 committed by GitHub
parent 0b6e8f7ef2
commit 199602016c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,17 +17,21 @@ defmodule Livebook.Evaluator.StringFormatter do
end end
defp syntax_colors() do defp syntax_colors() do
# Note: we intentionally don't specify colors
# for `:binary`, `:list`, `:map` and `:tuple`
# and rely on these using the default text color.
# This way we avoid a bunch of HTML tags for coloring commas, etc.
[ [
atom: :blue, atom: :blue,
binary: :light_black, # binary: :light_black,
boolean: :magenta, boolean: :magenta,
list: :light_black, # list: :light_black,
map: :light_black, # map: :light_black,
number: :blue, number: :blue,
nil: :magenta, nil: :magenta,
regex: :red, regex: :red,
string: :green, string: :green,
tuple: :light_black, # tuple: :light_black,
reset: :reset reset: :reset
] ]
end end