diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-04-20 18:07:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-20 18:07:57 +0100 |
commit | 8281a16efc76197f7b0b2a385dffb44fce66d33e (patch) | |
tree | 1eb1e1ecce79339788e2c1539d3dabf64b000dc5 /src/arglist.c | |
parent | be9624eb47ff4db4f068c65ad9cd37b14d1818a8 (diff) |
patch 9.0.1472: ":drop fname" may change the last used tab pagev9.0.1472
Problem: ":drop fname" may change the last used tab page.
Solution: Restore the last used tab page when :drop has changed it.
(closes #12087)
Diffstat (limited to 'src/arglist.c')
-rw-r--r-- | src/arglist.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/arglist.c b/src/arglist.c index bb31c45e93..a63f6c72f8 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -1240,6 +1240,8 @@ do_arg_all( need_mouse_correct = TRUE; #endif + tabpage_T *new_lu_tp = curtab; + // Try closing all windows that are not in the argument list. // Also close windows that are not full width; // When 'hidden' or "forceit" set the buffer becomes hidden. @@ -1247,6 +1249,10 @@ do_arg_all( // 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) |