0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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.
This commit is contained in:
Bram Moolenaar
2016-01-17 19:39:00 +01:00
parent 42c9cfa7f4
commit a24f0a550f
3 changed files with 57 additions and 2 deletions

View File

@@ -2836,6 +2836,7 @@ alist_add_list(count, files, after)
int after; /* where to add: 0 = before first one */
{
int i;
int old_argcount = ARGCOUNT;
if (ga_grow(&ALIST(curwin)->al_ga, count) == OK)
{
@@ -2852,8 +2853,8 @@ alist_add_list(count, files, after)
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;
}