File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2832,8 +2832,15 @@ ex_argdelete(exarg_T *eap)
28322832 if (eap -> line2 > ARGCOUNT )
28332833 eap -> line2 = ARGCOUNT ;
28342834 n = eap -> line2 - eap -> line1 + 1 ;
2835- if (* eap -> arg != NUL || n <= 0 )
2835+ if (* eap -> arg != NUL )
2836+ /* Can't have both a range and an argument. */
28362837 EMSG (_ (e_invarg ));
2838+ else if (n <= 0 )
2839+ {
2840+ /* Don't give an error for ":%argdel" if the list is empty. */
2841+ if (eap -> line1 != 1 || eap -> line2 != 0 )
2842+ EMSG (_ (e_invrange ));
2843+ }
28372844 else
28382845 {
28392846 for (i = eap -> line1 ; i <= eap -> line2 ; ++ i )
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ func Test_argidx()
66 call assert_equal (2 , argidx ())
77 % argdelete
88 call assert_equal (0 , argidx ())
9+ " doing it again doesn't result in an error
10+ % argdelete
11+ call assert_equal (0 , argidx ())
12+ call assert_fails (' 2argdelete' , ' E16:' )
913
1014 args a b c
1115 call assert_equal (0 , argidx ())
Original file line number Diff line number Diff line change @@ -764,6 +764,8 @@ static char *(features[]) =
764764
765765static int included_patches [] =
766766{ /* Add new patch number below this line */
767+ /**/
768+ 439 ,
767769/**/
768770 438 ,
769771/**/
You can’t perform that action at this time.
0 commit comments