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 From dfdf7c02be1758f4adfe487a36f372f514dda39a Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 12:40:05 +0200 Subject: vim-patch:7.4.1123 Problem: Using ":argadd" when there are no arguments results in the second argument to be the current one. (Yegappan Lakshmanan) Solution: Correct the w_arg_idx value. https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec --- src/nvim/ex_cmds2.c | 6 ++++-- src/nvim/version.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 18e09a7619..b6d0ef78cf 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2098,6 +2098,7 @@ alist_add_list ( int after /* where to add: 0 = before first one */ ) { + int old_argcount = ARGCOUNT; ga_grow(&ALIST(curwin)->al_ga, count); { if (after < 0) @@ -2112,8 +2113,9 @@ alist_add_list ( ARGLIST[after + i].ae_fnum = buflist_add(files[i], BLN_LISTED); } ALIST(curwin)->al_ga.ga_len += count; - if (curwin->w_arg_idx >= after) - ++curwin->w_arg_idx; + if (old_argcount > 0 && curwin->w_arg_idx >= after) { + curwin->w_arg_idx += count; + } return after; } } diff --git a/src/nvim/version.c b/src/nvim/version.c index 937d481e19..164f151741 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -559,7 +559,7 @@ static int included_patches[] = { // 1126, // 1125 NA // 1124 NA - // 1123, + 1123, // 1122 NA // 1121, 1120, -- cgit From 02fb6ee45843ac0b759f5bb15bbb3f3f418f0e74 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 13:26:27 +0200 Subject: vim-patch:7.4.1132 Problem: Old style tests for the argument list. Solution: Add more new style tests. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b --- src/nvim/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/version.c b/src/nvim/version.c index 164f151741..09f6ef6301 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -550,7 +550,7 @@ static int included_patches[] = { // 1135 NA // 1134 NA // 1133 NA - // 1132, + 1132, // 1131 NA // 1130, // 1129 NA -- cgit From 055c9e1be6d73fa4a4f84299dbdbcaf8e2db140a Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 14 May 2016 15:51:44 +0200 Subject: vim-patch:7.4.1161 Problem: ":argadd" without argument is supposed to add the current buffer name to the arglist. Solution: Make it work as documented. (Coot, closes vim/vim#577) https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8 --- src/nvim/ex_cmds.lua | 2 +- src/nvim/ex_cmds2.c | 12 +++++++++--- src/nvim/version.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 04fd88cc8d..6c58879d58 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -88,7 +88,7 @@ return { }, { command='argadd', - flags=bit.bor(BANG, NEEDARG, RANGE, NOTADR, ZEROR, FILES, TRLBAR), + flags=bit.bor(BANG, RANGE, NOTADR, ZEROR, FILES, TRLBAR), addr_type=ADDR_ARGUMENTS, func='ex_argadd', }, diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b6d0ef78cf..fd299eaa8a 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1487,9 +1487,15 @@ do_arglist ( char_u *p; int match; - /* - * Collect all file name arguments in "new_ga". - */ + // Set default argument for ":argadd" command. + if (what == AL_ADD && *str == NUL) { + if (curbuf->b_ffname == NULL) { + return FAIL; + } + str = curbuf->b_fname; + } + + // Collect all file name arguments in "new_ga". get_arglist(&new_ga, str); if (what == AL_DEL) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 09f6ef6301..da90bc588f 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -521,7 +521,7 @@ static int included_patches[] = { 1164, 1163, // 1162 NA - // 1161, + 1161, 1160, // 1159 NA // 1158 NA -- cgit