aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-09-14 09:43:24 +0200
committerGitHub <[email protected]>2017-09-14 09:43:24 +0200
commitbd36da0f509ee4e357fdf51b60f3dfcecc824eb8 (patch)
treea6ef081ed11aa6dd976fbb2869ac6c225507da4a /lib
parent8e5fff1eb3a967ebc66c4cec1dd91699cdea66c0 (diff)
parent5211e65b8a89f95d8a4371a1fefa252c2fccfea8 (diff)
downloadotp-bd36da0f509ee4e357fdf51b60f3dfcecc824eb8.tar.gz
otp-bd36da0f509ee4e357fdf51b60f3dfcecc824eb8.tar.bz2
otp-bd36da0f509ee4e357fdf51b60f3dfcecc824eb8.zip
Merge pull request #1549 from ggcampinho/fix-move-cursor
Consider ANSI escape codes on cp_pos_to_col
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/src/edlin.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stdlib/src/edlin.erl b/lib/stdlib/src/edlin.erl
index 64d5a71f3c..5df9c504f9 100644
--- a/lib/stdlib/src/edlin.erl
+++ b/lib/stdlib/src/edlin.erl
@@ -412,12 +412,12 @@ do_op(backward_word, Bef0, Aft0, Rs) ->
{Bef1,Aft1,N0} = over_non_word(Bef0, Aft0, 0),
{Bef,Aft,N} = over_word(Bef1, Aft1, N0),
{{Bef,Aft},[{move_rel,-N}|Rs]};
-do_op(beginning_of_line, [C|Bef], Aft, Rs) ->
- {{[],reverse(Bef, [C|Aft])},[{move_rel,-(cp_len(Bef)+1)}|Rs]};
+do_op(beginning_of_line, [_|_]=Bef, Aft, Rs) ->
+ {{[],reverse(Bef, Aft)},[{move_rel,-(cp_len(Bef))}|Rs]};
do_op(beginning_of_line, [], Aft, Rs) ->
{{[],Aft},Rs};
-do_op(end_of_line, Bef, [C|Aft], Rs) ->
- {{reverse(Aft, [C|Bef]),[]},[{move_rel,cp_len(Aft)+1}|Rs]};
+do_op(end_of_line, Bef, [_|_]=Aft, Rs) ->
+ {{reverse(Aft, Bef),[]},[{move_rel,cp_len(Aft)}|Rs]};
do_op(end_of_line, Bef, [], Rs) ->
{{Bef,[]},Rs};
do_op(ctlu, Bef, Aft, Rs) ->