aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-05-29 00:03:54 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-05-29 00:03:54 -0400
commit1e70ebe849e3e2a0bf9605485d5ef8c6b86b0e52 (patch)
tree2299628838916d666be9cc6c8966a42c61b960cb /src
parent5fed9f5626103eca5a0fe6d920c2e78456830a51 (diff)
parent36a57a9e8a311451cd40b7f8b2394fae6a67726f (diff)
downloadrneovim-1e70ebe849e3e2a0bf9605485d5ef8c6b86b0e52.tar.gz
rneovim-1e70ebe849e3e2a0bf9605485d5ef8c6b86b0e52.tar.bz2
rneovim-1e70ebe849e3e2a0bf9605485d5ef8c6b86b0e52.zip
Merge pull request #4756 from jbradaric/vim-7.4.1119
vim-patch:7.4.1119,7.4.1123,7.4.1132,7.4.1161
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.lua2
-rw-r--r--src/nvim/ex_cmds2.c28
-rw-r--r--src/nvim/version.c8
3 files changed, 26 insertions, 12 deletions
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 d167c28182..df4a6d52c4 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1616,9 +1616,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) {
@@ -1990,11 +1996,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();
}
@@ -2221,6 +2233,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)
@@ -2235,8 +2248,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 c491021328..2ba8deb0ce 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -531,7 +531,7 @@ static int included_patches[] = {
1164,
1163,
// 1162 NA
- // 1161,
+ 1161,
1160,
// 1159 NA
// 1158 NA
@@ -560,7 +560,7 @@ static int included_patches[] = {
// 1135 NA
// 1134 NA
// 1133 NA
- // 1132,
+ 1132,
// 1131 NA
// 1130,
// 1129 NA
@@ -569,11 +569,11 @@ static int included_patches[] = {
// 1126,
// 1125 NA
// 1124 NA
- // 1123,
+ 1123,
// 1122 NA
// 1121,
1120,
- // 1119,
+ 1119,
1118,
1117,
1116,