diff options
author | Ron Yorston | 2021-04-06 13:44:05 +0100 |
---|---|---|
committer | Denys Vlasenko | 2021-04-11 00:18:56 +0200 |
commit | f4a9908b4c21e5e8f544ab9d2bc3770b35942a6b (patch) | |
tree | 672a0715fd51c2523d8db3894dc53b640f885220 /libbb/lineedit.c | |
parent | 99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb (diff) | |
download | busybox-f4a9908b4c21e5e8f544ab9d2bc3770b35942a6b.zip busybox-f4a9908b4c21e5e8f544ab9d2bc3770b35942a6b.tar.gz |
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>
Diffstat (limited to 'libbb/lineedit.c')
0 files changed, 0 insertions, 0 deletions