busybox/editors
Ron Yorston d9d19896a9 vi: position cursor on last column of tab
Vi places the cursor on the last column of a tab character whereas
BusyBox vi puts it on the first.  This is disconcerting for
experienced vi users and makes it impossible to distinguish
visually between an empty line and one containing just a tab.

It wasn't always this way.  Prior to commit e3cbfb91d (vi: introduce
FEATURE_VI_8BIT) BusyBox vi also put the cursor on the last column.
However there were problems with cursor positioning when text was
inserted before a tab.  Commit eaabf0675 (vi: multiple fixes by
Natanael Copa) includes a partial attempt to fix this.  (The code is
still present but it's never executed.  Clever compilers optimise it
away.)

Revert the changes of commit e3cbfb91d and fix the insert problem
for all tabs, not just the first.

To quote Natanael:  "Costs a few bytes but its worth it imho".

function                                             old     new   delta
refresh                                              974    1000     +26
move_to_col                                           81      83      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 28/0)               Total: 28 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-15 13:09:12 +02:00
..
awk.c awk: allow printf('%c') to output NUL, closes 13486 2021-02-02 13:51:14 +01:00
cmp.c config: update size information 2018-12-28 03:20:17 +01:00
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
diff.c diff: code shrink 2021-02-22 19:00:07 +01:00
ed.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
Kbuild.src switch editors/* to embedded-in-source kbuild system 2013-11-13 12:45:33 +01:00
patch_bbox.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
patch_toybox.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
patch.c help text: replace [OPTIONS] with actual options (if not too long) 2020-12-13 22:34:05 +01:00
sed1line.txt add sed mini-doc 2007-11-13 17:13:31 +00:00
sed_summary.htm doc: add info about sed s/.../.../I modifier 2008-03-01 19:29:56 +00:00
sed.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
vi.c vi: position cursor on last column of tab 2021-04-15 13:09:12 +02:00