busybox/editors
Ron Yorston bb983f30e7 vi: fix faulty undo after autoinsert
Enable autoinsert and enter the following with an indent of three
spaces:

   line 1
   line 2

Using 'u' to undo the last insert results in:

   line1e 2

The insertion of the indent hasn't been properly recorded.

Since recording insertions is a common operation add a convenience
function, undo_push_insert(), to handle this and use it to record
the autoindent correctly.

function                                             old     new   delta
undo_push_insert                                       -      36     +36
string_insert                                        133     129      -4
char_insert                                          518     473     -45
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 36/-49)            Total: -13 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2019-02-08 12:57:58 +01:00
..
awk.c awk: Fix overly permissive func arg list parsing 2019-01-21 12:59:19 +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 regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
ed.c config: update size information 2018-12-28 03:20:17 +01:00
Kbuild.src switch editors/* to embedded-in-source kbuild system 2013-11-13 12:45:33 +01:00
patch_bbox.c getopt32: remove applet_long_options 2017-08-08 17:09:40 +02:00
patch_toybox.c config: update size information 2018-12-28 03:20:17 +01:00
patch.c config: update size information 2018-12-28 03:20:17 +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 sed: code shrink 2019-01-21 13:49:28 +01:00
vi.c vi: fix faulty undo after autoinsert 2019-02-08 12:57:58 +01:00