[PATCH] vi: restore 0 offset after :set noXXX command
Denys Vlasenko
vda.linux at googlemail.com
Mon Mar 1 13:42:06 UTC 2021
Applied, thank you.
On Sun, Feb 28, 2021 at 12:19 AM Alison Winters
<alisonatwork at outlook.com> wrote:
>
> Fixes bug where commands after the first noXXX command are ignored.
> e.g. :set noic tabstop=4
> ---
> editors/vi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/editors/vi.c b/editors/vi.c
> index 458ca6293..2010cd491 100644
> --- a/editors/vi.c
> +++ b/editors/vi.c
> @@ -2709,7 +2709,6 @@ static void colon(char *buf)
> # if ENABLE_FEATURE_VI_SETOPTS
> char *argp;
> # endif
> - i = 0; // offset into args
> // only blank is regarded as args delimiter. What about tab '\t'?
> if (!args[0] || strcasecmp(args, "all") == 0) {
> // print out values of all options
> @@ -2732,8 +2731,11 @@ static void colon(char *buf)
> # if ENABLE_FEATURE_VI_SETOPTS
> argp = args;
> while (*argp) {
> - if (strncmp(argp, "no", 2) == 0)
> + if (strncmp(argp, "no", 2) == 0) {
> i = 2; // ":set noautoindent"
> + } else {
> + i = 0;
> + }
> setops(argp, "autoindent ", i, "ai", VI_AUTOINDENT);
> setops(argp, "flash " , i, "fl", VI_ERR_METHOD);
> setops(argp, "ignorecase ", i, "ic", VI_IGNORECASE);
> --
> 2.30.1
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
More information about the busybox
mailing list