Skip to content

Commit 3f86e6d

Browse files
committed
Make IEx helpers use inspect_opts where appropriate
For instance, the v helper would print the results in their entirety ignoring the "limit" option.
1 parent 3390820 commit 3f86e6d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/iex/lib/iex/helpers.ex

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,13 @@ defmodule IEx.Helpers do
209209
their results.
210210
"""
211211
def v do
212-
IEx.History.each(print_history_entry(&1))
212+
inspect_opts = IEx.Options.get(:inspect)
213+
IEx.History.each(print_history_entry(&1, inspect_opts))
213214
end
214215

215-
defp print_history_entry(config) do
216+
defp print_history_entry(config, inspect_opts) do
216217
IO.write IEx.color(:info, "#{config.counter}: #{config.cache}#=> ")
217-
IO.puts IEx.color(:eval_result, "#{inspect config.result}\n")
218+
IO.puts IEx.color(:eval_result, "#{inspect config.result, inspect_opts}\n")
218219
end
219220

220221
@doc """
@@ -262,10 +263,15 @@ defmodule IEx.Helpers do
262263
Flushes all messages sent to the shell and prints them out.
263264
"""
264265
def flush do
266+
inspect_opts = IEx.Options.get(:inspect)
267+
do_flush(inspect_opts)
268+
end
269+
270+
defp do_flush(inspect_opts) do
265271
receive do
266272
msg ->
267-
IO.inspect(msg)
268-
flush
273+
IO.inspect(msg, inspect_opts)
274+
do_flush(inspect_opts)
269275
after
270276
0 -> :ok
271277
end

0 commit comments

Comments
 (0)