summaryrefslogtreecommitdiffstats
path: root/src/arglist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arglist.c')
-rw-r--r--src/arglist.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/arglist.c b/src/arglist.c
index 8e0f4d2e8e..1810367606 100644
--- a/src/arglist.c
+++ b/src/arglist.c
@@ -776,10 +776,20 @@ ex_argdelete(exarg_T *eap)
int i;
int n;
- if (eap->addr_count > 0)
+ if (eap->addr_count > 0 || *eap->arg == NUL)
{
- // ":1,4argdel": Delete all arguments in the range.
- if (eap->line2 > ARGCOUNT)
+ // ":argdel" works like ":argdel"
+ if (eap->addr_count == 0)
+ {
+ if (curwin->w_arg_idx >= ARGCOUNT)
+ {
+ emsg(_("E610: No argument to delete"));
+ return;
+ }
+ eap->line1 = eap->line2 = curwin->w_arg_idx + 1;
+ }
+ else if (eap->line2 > ARGCOUNT)
+ // ":1,4argdel": Delete all arguments in the range.
eap->line2 = ARGCOUNT;
n = eap->line2 - eap->line1 + 1;
if (*eap->arg != NUL)
@@ -808,8 +818,6 @@ ex_argdelete(exarg_T *eap)
curwin->w_arg_idx = ARGCOUNT - 1;
}
}
- else if (*eap->arg == NUL)
- emsg(_(e_argreq));
else
do_arglist(eap->arg, AL_DEL, 0, FALSE);
#ifdef FEAT_TITLE