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.

a24f0a550f
This commit is contained in:
Jurica Bradaric
2016-05-14 12:40:05 +02:00
parent 1573aa0b0a
commit dfdf7c02be
3 changed files with 56 additions and 4 deletions

View File

@@ -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;
}
}