Skip to content

Commit

Permalink
do put_chars instead of insert_chars, since we
Browse files Browse the repository at this point in the history
assume a dumb terminal.
  • Loading branch information
frazze-jobb committed Nov 8, 2023
1 parent fbaf1fa commit b7dc3ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/kernel/src/group.erl
Original file line number Diff line number Diff line change
Expand Up @@ -914,17 +914,17 @@ edit_line(eof, Chars, Rs) ->
edit_line([],Chars, Rs) ->
{Chars,[],lists:reverse(Rs)};
edit_line([$\r,$\n|Cs],Chars, Rs) ->
{[$\n | Chars], remainder_after_nl(Cs), lists:reverse([{insert_chars, unicode, "\n"}|Rs])};
{[$\n | Chars], remainder_after_nl(Cs), lists:reverse([{put_chars, unicode, "\n"}|Rs])};
edit_line([NL|Cs],Chars, Rs) when NL =:= $\r; NL =:= $\n ->
{[$\n | Chars], remainder_after_nl(Cs), lists:reverse([{insert_chars, unicode, "\n"}|Rs])};
{[$\n | Chars], remainder_after_nl(Cs), lists:reverse([{put_chars, unicode, "\n"}|Rs])};
edit_line([Erase|Cs],[], Rs) when Erase =:= $\177; Erase =:= $\^H ->
edit_line(Cs,[], Rs);
edit_line([Erase|Cs],[_|Chars], Rs) when Erase =:= $\177; Erase =:= $\^H ->
edit_line(Cs,Chars, [{delete_chars, -1}|Rs]);
edit_line([CtrlChar|Cs],Chars, Rs) when CtrlChar =< 32 ->
edit_line(Cs,Chars,Rs);
edit_line([Char|Cs],Chars, Rs) ->
edit_line(Cs,[Char|Chars], [{insert_chars, unicode, [Char]}|Rs]).
edit_line(Cs,[Char|Chars], [{put_chars, unicode, [Char]}|Rs]).

remainder_after_nl("") -> done;
remainder_after_nl(Cs) -> Cs.
Expand Down

0 comments on commit b7dc3ab

Please sign in to comment.