We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7ffebc commit b0bc02eCopy full SHA for b0bc02e
lib/elixir/lib/io.ex
@@ -153,10 +153,14 @@ defmodule IO do
153
"""
154
def inspect(device, item, opts) when is_list(opts) do
155
opts = Keyword.put_new(opts, :pretty, true)
156
- opts = case :io.columns(device) do
157
- { :ok, width } -> Keyword.put_new(opts, :width, width)
158
- { :error, _ } -> opts
+
+ unless Keyword.get(opts, :width) do
+ opts = case :io.columns(device) do
159
+ { :ok, width } -> Keyword.put(opts, :width, width)
160
+ { :error, _ } -> opts
161
+ end
162
end
163
164
puts device, Kernel.inspect(item, opts)
165
item
166
0 commit comments