aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-05-19 15:23:55 +0000
committerErlang/OTP <[email protected]>2010-05-19 15:23:55 +0000
commit1b6125a1959e574c02bc13edcae71d110257a632 (patch)
tree18cbe55f82caf8d514e8879cf1d7980c61020318 /lib/stdlib/src
parent0fd5c90fe8a5b07b93735f769f8103dad9441f3d (diff)
parent91e912b49d035821301e7005955908f2040a495f (diff)
downloadotp-1b6125a1959e574c02bc13edcae71d110257a632.tar.gz
otp-1b6125a1959e574c02bc13edcae71d110257a632.tar.bz2
otp-1b6125a1959e574c02bc13edcae71d110257a632.zip
Merge branch 'dp/shell-line-editing' into dev
* dp/shell-line-editing: Readline-style line edit history OTP-8635 dp/shell-line-editing The shell's line editing has been improved to more resemble the behaviour of readline and other shells. (Thanks to Dave Peticolas)
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/edlin.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl
index 6cb441dbed..026bd9038f 100644
--- a/lib/stdlib/src/edlin.erl
+++ b/lib/stdlib/src/edlin.erl
@@ -24,6 +24,7 @@
-export([init/0,start/1,edit_line/2,prefix_arg/1]).
-export([erase_line/1,erase_inp/1,redraw_line/1]).
-export([length_before/1,length_after/1,prompt/1]).
+-export([current_line/1]).
%%-export([expand/1]).
-export([edit_line1/2]).
@@ -421,6 +422,7 @@ over_paren_auto([], _, _, _) ->
%% length_before(Line)
%% length_after(Line)
%% prompt(Line)
+%% current_line(Line)
%% Various functions for accessing bits of a line.
erase_line({line,Pbs,{Bef,Aft},_}) ->
@@ -447,6 +449,9 @@ length_after({line,_,{_Bef,Aft},_}) ->
prompt({line,Pbs,_,_}) ->
Pbs.
+current_line({line,_,{Bef, Aft},_}) ->
+ reverse(Bef, Aft ++ "\n").
+
%% %% expand(CurrentBefore) ->
%% %% {yes,Expansion} | no
%% %% Try to expand the word before as either a module name or a function