Skip to content

Commit 6fc468b

Browse files
author
Thomaz Leite
committed
Refactor ANSIDocs.write helper
1 parent 5b6fc9b commit 6fc468b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/iex/lib/iex/ansi_docs.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,8 @@ defmodule IEx.ANSIDocs do
203203
## Helpers
204204

205205
defp write(style, string, colors) do
206-
color = colors[style]
207-
enabled = colors[:enabled]
208-
seq_color = IO.ANSI.escape_fragment("%{#{color}}", enabled)
209-
seq_reset = IO.ANSI.escape_fragment("%{reset}", enabled)
210-
IO.puts seq_color <> string <> seq_reset
211-
IO.puts seq_reset
206+
IO.puts color(style, colors) <> string <> IO.ANSI.reset
207+
IO.puts IO.ANSI.reset
212208
end
213209

214210
defp write_with_wrap([], _available, _indent, _first) do

0 commit comments

Comments
 (0)