busybox/editors
Ron Yorston b18c7bf702 vi: improvements to undo
The left shift operator ('<') didn't support undo at all; right
shift ('>') required changes to be undone separately for each line.
Allow both types of shift to be undone as a single operation.

Also, neither traditional vi nor vim yank the lines being shifted by
the '<' and '>' commands, so remove that call to yank_delete();

When a repetition count was specified for the '~', 'x', 'X' or 's'
commands the changes had to be undone one character at a time.
Allow undo as a single operation (though the delete and change
parts of the 's' command still have to be undone separately).

function                                             old     new   delta
undo_push_insert                                      37      40      +3
do_cmd                                              4695    4663     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 3/-32)             Total: -29 bytes

v2: Don't break build when FEATURE_VI_UNDO is  disabled.  Don't reset
    'undo_del' too early in '~' handling code.  Code shrink '~'.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-11 00:18:55 +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: improvements to undo 2021-04-11 00:18:55 +02:00