Permalink
Browse files

Coloring complete

  • Loading branch information...
1 parent 0b47851 commit 17d64f0d2c39f3045e710ab815a8f73c0aac66f2 @BjRo committed Jan 21, 2014
Showing with 7 additions and 1 deletion.
  1. +1 −0 lib/apex/format/color.ex
  2. +6 −1 lib/apex/format/seq.ex
View
1 lib/apex/format/color.ex
@@ -14,6 +14,7 @@ defmodule Apex.Format.Color do
defp color(data) when is_float(data), do: :blue
defp color(data) when is_integer(data), do: :blue
defp color(data) when is_function(data), do: :purpleish
+ defp color(data) when is_list(data), do: :white
defp color({Range, _, _}), do: :greenish
defp color({HashSet, _, _}), do: :whiteish
defp color({HashDict, _, _}), do: :whiteish
View
7 lib/apex/format/seq.ex
@@ -1,5 +1,6 @@
defmodule Apex.Format.Seq do
import Apex.Format.Utils
+ @list []
def format(data, options, config // []) do
pre = start_token(config) <> new_line
@@ -14,7 +15,11 @@ defmodule Apex.Format.Seq do
end
defp do_format({entry, i}, options, config) do
- number = if numbers?(config), do: "[#{i}] ", else: ""
+ number = if numbers?(config) do
+ colorize("[#{i}] ", @list, options)
+ else
+ ""
+ end
indent(options) <> number <> Apex.Format.format(entry, options)
end

0 comments on commit 17d64f0

Please sign in to comment.