From 1573aa0b0a0a17da93e4fb2220fd5d6ecbd6d267 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 12:26:03 +0200 Subject: vim-patch:7.4.1119 Problem: argidx() has a wrong value after ":%argdelete". (Yegappan Lakshmanan) Solution: Correct the value of w_arg_idx. Add a test. https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e --- src/nvim/ex_cmds2.c | 10 ++++++++-- src/nvim/version.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 12efddc205..18e09a7619 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1861,11 +1861,17 @@ void ex_argdelete(exarg_T *eap) } else if (curwin->w_arg_idx > eap->line1) { curwin->w_arg_idx = (int)eap->line1; } + if (ARGCOUNT == 0) { + curwin->w_arg_idx = 0; + } else if (curwin->w_arg_idx >= ARGCOUNT) { + curwin->w_arg_idx = ARGCOUNT - 1; + } } - } else if (*eap->arg == NUL) + } else if (*eap->arg == NUL) { EMSG(_(e_argreq)); - else + } else { do_arglist(eap->arg, AL_DEL, 0); + } maketitle(); } diff --git a/src/nvim/version.c b/src/nvim/version.c index b55d31ea76..937d481e19 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -563,7 +563,7 @@ static int included_patches[] = { // 1122 NA // 1121, 1120, - // 1119, + 1119, 1118, 1117, 1116, -- cgit