File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2562,6 +2562,10 @@ ex_argdelete(eap)
25622562 curwin -> w_arg_idx -= n ;
25632563 else if (curwin -> w_arg_idx > eap -> line1 )
25642564 curwin -> w_arg_idx = eap -> line1 ;
2565+ if (ARGCOUNT == 0 )
2566+ curwin -> w_arg_idx = 0 ;
2567+ else if (curwin -> w_arg_idx >= ARGCOUNT )
2568+ curwin -> w_arg_idx = ARGCOUNT - 1 ;
25652569 }
25662570 }
25672571 else if (* eap -> arg == NUL )
Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ SCRIPTS_GUI = test16.out
171171
172172# Tests using runtest.vim.vim.
173173# Keep test_alot.res as the last one, sort the others.
174- NEW_TESTS = test_assert.res \
174+ NEW_TESTS = test_arglist.res \
175+ test_assert.res \
175176 test_cdo.res \
176177 test_hardcopy.res \
177178 test_increment.res \
Original file line number Diff line number Diff line change 1+ " Test argument list commands
2+
3+ func Test_argidx ()
4+ args a b c
5+ last
6+ call assert_equal (2 , argidx ())
7+ % argdelete
8+ call assert_equal (0 , argidx ())
9+
10+ args a b c
11+ call assert_equal (0 , argidx ())
12+ next
13+ call assert_equal (1 , argidx ())
14+ next
15+ call assert_equal (2 , argidx ())
16+ 1 argdelete
17+ call assert_equal (1 , argidx ())
18+ 1 argdelete
19+ call assert_equal (0 , argidx ())
20+ 1 argdelete
21+ call assert_equal (0 , argidx ())
22+ endfunc
Original file line number Diff line number Diff line change @@ -741,6 +741,8 @@ static char *(features[]) =
741741
742742static int included_patches [] =
743743{ /* Add new patch number below this line */
744+ /**/
745+ 1119 ,
744746/**/
745747 1118 ,
746748/**/
You can’t perform that action at this time.
0 commit comments