diff options
Diffstat (limited to 'src/nvim/arglist.c')
-rw-r--r-- | src/nvim/arglist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c index e9108f72cc..a02c22deae 100644 --- a/src/nvim/arglist.c +++ b/src/nvim/arglist.c @@ -1093,11 +1093,6 @@ static void do_arg_all(int count, int forceit, int keep_tabs) // When the ":tab" modifier was used do this for all tab pages. arg_all_close_unused_windows(&aall); - // Now set the last used tabpage to where we started. - if (valid_tabpage(new_lu_tp)) { - lastused_tabpage = new_lu_tp; - } - // Open a window for files in the argument list that don't have one. // ARGCOUNT may change while doing this, because of autocommands. if (count > aall.opened_len || count <= 0) { @@ -1134,6 +1129,12 @@ static void do_arg_all(int count, int forceit, int keep_tabs) if (valid_tabpage(aall.new_curtab)) { goto_tabpage_tp(aall.new_curtab, true, true); } + + // Now set the last used tabpage to where we started. + if (valid_tabpage(new_lu_tp)) { + lastused_tabpage = new_lu_tp; + } + if (win_valid(aall.new_curwin)) { win_enter(aall.new_curwin, false); } |