busybox/editors
Ron Yorston 2617a5e4c6 vi: handle autoindent in 'cc' command
When the 'cc' command is invoked with autoindent enabled it
should use the indent of the first line being changed.

The size of the indent has to be established before char_insert()
is called as the lines being changed are deleted.  Introduce a
new global variable, newindent, to handle this.  The indentcol
global is now effectively a static variable in char_insert().

function                                             old     new   delta
do_cmd                                              4247    4308     +61
vi_main                                              416     422      +6
char_insert                                          891     875     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 67/-16)             Total: 51 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-06-26 19:38:31 +02:00
..
awk.c awk: input numbers are never octal or hex (only program consts can be) 2022-01-08 22:42:35 +01:00
cmp.c Add support for long options to cmp 2022-01-23 20:24:32 +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 ed: add support for -s command-line option as mandated by POSIX 2021-12-29 19:01:32 +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: shrink lineedit_read_key() 2022-01-18 00:36:42 +01:00
patch.c libbb: shrink lineedit_read_key() 2022-01-18 00:36:42 +01:00
sed1line.txt
sed_summary.htm
sed.c sed: fix handling of escaped delimiters in s/// replacement 2022-01-23 19:04:27 +01:00
vi.c vi: handle autoindent in 'cc' command 2022-06-26 19:38:31 +02:00