patch 7.4.1119
Problem:    argidx() has a wrong value after ":%argdelete". (Yegappan
            Lakshmanan)
Solution:   Correct the value of w_arg_idx.  Add a test.
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 5b11366..012a1af 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2562,6 +2562,10 @@
 		curwin->w_arg_idx -= n;
 	    else if (curwin->w_arg_idx > eap->line1)
 		curwin->w_arg_idx = 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)