aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/io_lib_pretty.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-04-17 14:55:35 +0200
committerHans Bolinder <[email protected]>2018-04-25 12:30:06 +0200
commit513e6c069c31da33d435d16d811211eee7e16399 (patch)
tree569917dc0034701cd18b8dcab2795830b9a645a1 /lib/stdlib/src/io_lib_pretty.erl
parentd3f0d1785e5847031f21484ca99c503c6ef704b8 (diff)
downloadotp-513e6c069c31da33d435d16d811211eee7e16399.tar.gz
otp-513e6c069c31da33d435d16d811211eee7e16399.tar.bz2
otp-513e6c069c31da33d435d16d811211eee7e16399.zip
stdlib: Modify ~w/~W when number of characters is limited
A bug fix: limited maps end with "...", not "...=>...". A modification: wW separate pairs with " => ", not "=>". When the output is limited on number of characters, the term is balanced by wW the same way as is done with pP (see commit bc38638).
Diffstat (limited to 'lib/stdlib/src/io_lib_pretty.erl')
-rw-r--r--lib/stdlib/src/io_lib_pretty.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl
index 785c602ac0..9b0000ded0 100644
--- a/lib/stdlib/src/io_lib_pretty.erl
+++ b/lib/stdlib/src/io_lib_pretty.erl
@@ -26,6 +26,9 @@
-export([print/1,print/2,print/3,print/4,print/5,print/6]).
+%% To be used by io_lib only.
+-export([intermediate/6, write/1]).
+
%%%
%%% Exported functions
%%%
@@ -573,10 +576,10 @@ print_length(<<_/bitstring>> = Bin, D, T, RF, Enc, Str) ->
end,
{[$<,$<,S|"/utf8...>>"], 12 + length(S), 3, More};
false when byte_size(Bin) < D ->
- S = io_lib:write(Bin, D),
+ S = io_lib:write_binary(Bin, D),
{{bin, S}, iolist_size(S), 0, no_more};
false ->
- S = io_lib:write(Bin, D),
+ S = io_lib:write_binary(Bin, D),
More = fun(T1, Dd) ->
?FUNCTION_NAME(Bin, D+Dd, T1, RF, Enc, Str)
end,