aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/edlin.erl
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2014-10-01 10:07:03 -0400
committerSteve Vinoski <[email protected]>2014-10-01 10:07:03 -0400
commit81094cfd7b80a0cfe80f88c8fecb394744ceb90f (patch)
tree5a2660cb95acec07f6942be01c5099170122074a /lib/stdlib/src/edlin.erl
parent86ae7ccc44b38137c504a46b619ffad935d74b99 (diff)
downloadotp-81094cfd7b80a0cfe80f88c8fecb394744ceb90f.tar.gz
otp-81094cfd7b80a0cfe80f88c8fecb394744ceb90f.tar.bz2
otp-81094cfd7b80a0cfe80f88c8fecb394744ceb90f.zip
Make shell ctrl-u save killed text correctly
Fix edlin to correctly save text killed with ctrl-u. Prior to this fix, entering text into the Erlang shell and then killing it with ctrl-u followed by yanking it back with ctrl-y would result in the yanked text being the reverse of the original killed text. Add a test for the fix to interactive_shell_SUITE. (This is the same fix as in PR#416, but that PR was never completed.)
Diffstat (limited to 'lib/stdlib/src/edlin.erl')
-rw-r--r--lib/stdlib/src/edlin.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl
index be9a4f5107..b3bc5f6d92 100644
--- a/lib/stdlib/src/edlin.erl
+++ b/lib/stdlib/src/edlin.erl
@@ -390,7 +390,7 @@ do_op(end_of_line, Bef, [C|Aft], Rs) ->
do_op(end_of_line, Bef, [], Rs) ->
{{Bef,[]},Rs};
do_op(ctlu, Bef, Aft, Rs) ->
- put(kill_buffer, Bef),
+ put(kill_buffer, reverse(Bef)),
{{[], Aft}, [{delete_chars, -length(Bef)} | Rs]};
do_op(beep, Bef, Aft, Rs) ->
{{Bef,Aft},[beep|Rs]};