diff options
author | glepnir <glephunter@gmail.com> | 2024-02-09 19:30:26 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-09 19:30:26 +0100 |
commit | 2975a54f285e5b4bf026c1dc706b5d90777d64e7 (patch) | |
tree | 1874df2e2991d1e6046e1a7b6eb704f89f5eb4f5 /src | |
parent | 725c7c31a4c7603e688511d769b0addaab442d07 (diff) |
patch 9.1.0087: Restoring lastused_tabpage too early in do_arg_all()v9.1.0087
Problem: Restore lastused_tabpage too early in do_arg_all() function it
will change later in the function.
Solution: Restore lastused_tabpage a bit later, when being done with
tabpages (glepnir)
closes: #13992
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/arglist.c | 9 | ||||
-rw-r--r-- | src/testdir/test_tabpage.vim | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/arglist.c b/src/arglist.c index 292af30a14..723133254a 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -1253,10 +1253,6 @@ 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) @@ -1291,6 +1287,11 @@ do_arg_all( // to window with first arg 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); diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index 46aed221e4..94f695323f 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -156,10 +156,13 @@ func Test_tabpage_drop() tab split f3 normal! gt call assert_equal(1, tabpagenr()) + tab drop f4 + call assert_equal(1, tabpagenr('#')) tab drop f3 - call assert_equal(3, tabpagenr()) - call assert_equal(1, tabpagenr('#')) + call assert_equal(4, tabpagenr()) + call assert_equal(2, tabpagenr('#')) + bwipe! bwipe! bwipe! bwipe! diff --git a/src/version.c b/src/version.c index 8002c95b6d..08a78b6001 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 87, +/**/ 86, /**/ 85, |