busybox/editors
Ron Yorston 310ef23280 vi: add expandtab option
This implements the vim option expandtab in BusyBox vi.  From
vim help:

  In Insert mode: Use the appropriate number of spaces to insert a
  <Tab>.  Spaces are used in indents with the '>' and '<' commands and
  when 'autoindent' is on.  To insert a real tab when 'expandtab' is
  on, use CTRL-V<Tab>.

This implementation doesn't change how BusyBox vi handles autoindent:
it continues to copy the indentation from a neighbouring line.  If
that line has tabs in its indentation so too will the new line.

function                                             old     new   delta
char_insert                                          563     679    +116
next_column                                            -      48     +48
.rodata                                           105211  105236     +25
colon                                               3844    3855     +11
refresh                                             1000     982     -18
move_to_col                                           83      59     -24
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/2 up/down: 200/-42)           Total: 158 bytes

Signed-off-by: Peter D <urmum69@snopyta.org>
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-20 11:21:43 +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: add expandtab option 2021-04-20 11:21:43 +02:00