aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-05-14 12:40:05 +0200
committerJurica Bradaric <jbradaric@gmail.com>2016-05-14 15:51:30 +0200
commitdfdf7c02be1758f4adfe487a36f372f514dda39a (patch)
treeb71d36e03a29d435be63bc29a852937828f86299 /src
parent1573aa0b0a0a17da93e4fb2220fd5d6ecbd6d267 (diff)
downloadrneovim-dfdf7c02be1758f4adfe487a36f372f514dda39a.tar.gz
rneovim-dfdf7c02be1758f4adfe487a36f372f514dda39a.tar.bz2
rneovim-dfdf7c02be1758f4adfe487a36f372f514dda39a.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds2.c6
-rw-r--r--src/nvim/version.c2
2 files changed, 5 insertions, 3 deletions
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,