24effc7a3f
The 'y' command to yank text should leave the cursor at the start of the range. This mostly works correctly in BusyBox vi but not for whole-line yanks with backward motion, e.g. '2yk' to yank two lines backwards. In this case the cursor is left at the end of the range. Fix this by returning the actual range from find_range(). Cursor positioning following whole-line deletion is inconsistent between vim and traditional vi. For BusyBox vi chose the option that uses least code without being exactly compatible with either. Also, find_range() preserved the value of 'dot', the current cursor position. Since this isn't used by either caller of find_range() we can save a few bytes by not bothering. function old new delta do_cmd 4730 4759 +29 find_range 749 686 -63 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 29/-63) Total: -34 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> |
||
---|---|---|
.. | ||
awk.c | ||
cmp.c | ||
Config.src | ||
diff.c | ||
ed.c | ||
Kbuild.src | ||
patch_bbox.c | ||
patch_toybox.c | ||
patch.c | ||
sed1line.txt | ||
sed_summary.htm | ||
sed.c | ||
vi.c |