busybox/editors
Ron Yorston f4a9908b4c vi: improvements to reporting of changes
Traditional vi is mostly silent about the results of yank, delete,
change, undo or substitution commands.  Vim reports some details
about undo and substitution.  BusyBox vi is positively verbose in
comparison.

Make some improvements to BusyBox vi:

- Add vim-like reporting of changes caused by substitutions, of
  the form '64 substitutions on 53 lines'.  This replaces a fairly
  useless report of the result of the last change made.

- Ensure that the report about put operations correctly reflects the
  newly introduced repetition count.

- Commit 25d2592640 tried to limit status updates for delete and
  yank operations by detecting whether the register had changed.
  This didn't always work because the previously allocated memory
  could be reused for the new register contents.  Fix this by
  delaying freeing the old register until after the new one has
  been allocated.

- Add a configuration option to control verbose status reporting.
  This is on by default.  Turning it off make BusyBox vi as taciturn
  as traditional vi and saves 435 bytes.

function                                             old     new   delta
colon                                               3212    3292     +80
yank_status                                            -      74     +74
static.text_yank                                      99      86     -13
string_insert                                        130      76     -54
do_cmd                                              4842    4776     -66
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 154/-133)           Total: 21 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-11 00:18:56 +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 reporting of changes 2021-04-11 00:18:56 +02:00