aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-04-22 14:09:48 +0200
committerPeter Andersson <[email protected]>2015-04-22 14:09:48 +0200
commitd756777e731fe7a8d63690ca0246c9cbd53dea75 (patch)
tree6ce5e34c09c6f79c6db12b858a6ac41c8efe5e2b /lib/stdlib/src
parentfc130e699774228f396dc6f4fef4b654edc00451 (diff)
downloadotp-d756777e731fe7a8d63690ca0246c9cbd53dea75.tar.gz
otp-d756777e731fe7a8d63690ca0246c9cbd53dea75.tar.bz2
otp-d756777e731fe7a8d63690ca0246c9cbd53dea75.zip
Fix problem with unitialized edlin text buffer
Also make it possible to copy text buffer from current group process to the JCL mode
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/edlin.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl
index b3bc5f6d92..362669545e 100644
--- a/lib/stdlib/src/edlin.erl
+++ b/lib/stdlib/src/edlin.erl
@@ -21,7 +21,7 @@
%% A simple Emacs-like line editor.
%% About Latin-1 characters: see the beginning of erl_scan.erl.
--export([init/0,start/1,start/2,edit_line/2,prefix_arg/1]).
+-export([init/0,init/1,start/1,start/2,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, current_chars/1]).
@@ -44,6 +44,20 @@
init() ->
put(kill_buffer, []).
+init(Pid) ->
+ %% copy the kill_buffer from the process Pid
+ CopiedKillBuf =
+ case erlang:process_info(Pid, dictionary) of
+ {dictionary,Dict} ->
+ case proplists:get_value(kill_buffer, Dict) of
+ undefined -> [];
+ Buf -> Buf
+ end;
+ undefined ->
+ []
+ end,
+ put(kill_buffer, CopiedKillBuf).
+
%% start(Prompt)
%% edit(Characters, Continuation)
%% Return