diff options
author | Dan Gudmundsson <[email protected]> | 2017-09-14 09:46:14 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2017-09-14 09:46:14 +0200 |
commit | 2e8d9a446ef77391ae7faf6ee321479f6af5a92b (patch) | |
tree | b82e22ab231fdfe77edaf5fa29719a0b7bcff464 /lib | |
parent | c39ffbd27c1bf61be512e1c5edbee63d244bc8f0 (diff) | |
parent | bd36da0f509ee4e357fdf51b60f3dfcecc824eb8 (diff) | |
download | otp-2e8d9a446ef77391ae7faf6ee321479f6af5a92b.tar.gz otp-2e8d9a446ef77391ae7faf6ee321479f6af5a92b.tar.bz2 otp-2e8d9a446ef77391ae7faf6ee321479f6af5a92b.zip |
Merge branch 'maint'
* maint:
stdlib: Fix jumping to beginning or end of line
Fix del_chars not considering wide chars and update buffer length before calling write_buf
Make cp_pos_to_col function aware of the ANSI escape codes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/edlin.erl | 8 |
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) -> |