File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1240,13 +1240,19 @@ do_arg_all(
12401240 need_mouse_correct = TRUE;
12411241#endif
12421242
1243+ tabpage_T * new_lu_tp = curtab ;
1244+
12431245 // Try closing all windows that are not in the argument list.
12441246 // Also close windows that are not full width;
12451247 // When 'hidden' or "forceit" set the buffer becomes hidden.
12461248 // Windows that have a changed buffer and can't be hidden won't be closed.
12471249 // When the ":tab" modifier was used do this for all tab pages.
12481250 arg_all_close_unused_windows (& aall );
12491251
1252+ // Now set the last used tabpage to where we started.
1253+ if (valid_tabpage (new_lu_tp ))
1254+ lastused_tabpage = new_lu_tp ;
1255+
12501256 // Open a window for files in the argument list that don't have one.
12511257 // ARGCOUNT may change while doing this, because of autocommands.
12521258 if (count > aall .opened_len || count <= 0 )
Original file line number Diff line number Diff line change @@ -150,6 +150,22 @@ function Test_tabpage()
150150 tabonly !
151151endfunc
152152
153+ func Test_tabpage_drop ()
154+ edit f1
155+ tab split f2
156+ tab split f3
157+ normal ! gt
158+ call assert_equal (1 , tabpagenr ())
159+
160+ tab drop f3
161+ call assert_equal (3 , tabpagenr ())
162+ call assert_equal (1 , tabpagenr (' #' ))
163+ bwipe!
164+ bwipe!
165+ bwipe!
166+ call assert_equal (1 , tabpagenr (' $' ))
167+ endfunc
168+
153169" Test autocommands
154170function Test_tabpage_with_autocmd ()
155171 command -nargs =1 - bar C :call add (s: li , ' === ' . <q-args> . ' ===' )|<args>
Original file line number Diff line number Diff line change @@ -695,6 +695,8 @@ static char *(features[]) =
695695
696696static int included_patches [] =
697697{ /* Add new patch number below this line */
698+ /**/
699+ 1472 ,
698700/**/
699701 1471 ,
700702/**/
You can’t perform that action at this time.
0 commit comments