diff options
author | Hans Bolinder <[email protected]> | 2015-11-27 09:16:03 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-11-27 09:16:03 +0100 |
commit | a838b671ef9cc7582f0768778a0447df614b71dd (patch) | |
tree | c74e4dc0d06b1e9c56aa415993518beffc814b44 /lib/stdlib | |
parent | 4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9 (diff) | |
parent | 49014e56350dc942fb950da98075cc781ea3b63a (diff) | |
download | otp-a838b671ef9cc7582f0768778a0447df614b71dd.tar.gz otp-a838b671ef9cc7582f0768778a0447df614b71dd.tar.bz2 otp-a838b671ef9cc7582f0768778a0447df614b71dd.zip |
Merge branch 'hb/stdlib/fix_shell_strings/OTP-13145' into maint
* hb/stdlib/fix_shell_strings/OTP-13145:
stdlib: Fix the shell command rp and pretty-printing
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/shell.erl | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index f215a66812..ce1d9eb0ff 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -999,12 +999,7 @@ local_func(rl, [A], Bs0, _Shell, RT, Lf, Ef) -> {value,list_records(record_defs(RT, listify(Recs))),Bs}; local_func(rp, [A], Bs0, _Shell, RT, Lf, Ef) -> {[V],Bs} = expr_list([A], Bs0, Lf, Ef), - Cs = io_lib_pretty:print(V, ([{column, 1}, - {line_length, columns()}, - {depth, -1}, - {max_chars, ?CHAR_MAX}, - {record_print_fun, record_print_fun(RT)}] - ++ enc())), + Cs = pp(V, _Column=1, _Depth=-1, RT), io:requests([{put_chars, unicode, Cs}, nl]), {value,ok,Bs}; local_func(rr, [A], Bs0, _Shell, RT, Lf, Ef) -> @@ -1397,9 +1392,9 @@ get_history_and_results() -> {History, erlang:min(Results, History)}. pp(V, I, RT) -> - pp(V, I, RT, enc()). + pp(V, I, _Depth=?LINEMAX, RT). -pp(V, I, RT, Enc) -> +pp(V, I, D, RT) -> Strings = case application:get_env(stdlib, shell_strings) of {ok, false} -> @@ -1408,10 +1403,10 @@ pp(V, I, RT, Enc) -> true end, io_lib_pretty:print(V, ([{column, I}, {line_length, columns()}, - {depth, ?LINEMAX}, {max_chars, ?CHAR_MAX}, + {depth, D}, {max_chars, ?CHAR_MAX}, {strings, Strings}, {record_print_fun, record_print_fun(RT)}] - ++ Enc)). + ++ enc())). columns() -> case io:columns() of |