diff options
author | Ron Yorston | 2022-03-18 11:29:53 +0000 |
---|---|---|
committer | Denys Vlasenko | 2022-06-26 19:38:28 +0200 |
commit | af3b585815de5af367995d6064d994394b46c928 (patch) | |
tree | 185ee176c0c7d472906e01e2d51b0628a0eec099 /shell | |
parent | 7d1c7d8337853ca99e6ec1150ac4b834cfed5cd3 (diff) | |
download | busybox-af3b585815de5af367995d6064d994394b46c928.zip busybox-af3b585815de5af367995d6064d994394b46c928.tar.gz |
vi: fix regression in autoindent handling
Suppose autoindent is enabled and we have a line with an initial
tab where we want to split the words onto separate lines:
split the words
One way to do this is with the sequence 'f r<CR>;r<CR>', but in
BusyBox vi the result is:
split
he
words
This is a regression introduced by commit 9659a8db1 (vi: remove
autoindent from otherwise empty lines). The amount of indentation
is being recorded when the 'r' command inserts a newline but
isn't subsequently reset. A fix is to only record the indent
when in insert or replace mode. Proper handling of the 'o' and
'O' commands then requires them to switch to insert mode before
calling char_insert() to insert a newline.
function old new delta
char_insert 884 891 +7
do_cmd 4243 4247 +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 11/0) Total: 11 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
0 files changed, 0 insertions, 0 deletions