busybox/editors
Ron Yorston fc7868602e vi: improved handling of backspace in replace mode
In replace mode ('R' command) the backspace character should get
special treatment:

- backspace only goes back to the start of the replacement;
- backspacing over replaced characters restores the original text.

Prior to this commit BusyBox vi deleted the characters both before
and after the cursor in replace mode.

function                                             old     new   delta
undo_pop                                               -     235    +235
char_insert                                          858     884     +26
indicate_error                                        81      84      +3
find_range                                           654     657      +3
static.text_yank                                      77      79      +2
do_cmd                                              4486    4243    -243
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/1 up/down: 269/-243)           Total: 26 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-03-04 22:57:05 +01: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: improved handling of backspace in replace mode 2022-03-04 22:57:05 +01:00