vim-patch:9.0.1472: ":drop fname" may change the last used tab page (#23230)

Problem:    ":drop fname" may change the last used tab page.
Solution:   Restore the last used tab page when :drop has changed it.
            (closes vim/vim#12087)

8281a16efc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-04-21 09:02:30 +08:00
committed by GitHub
parent c4fb418626
commit f1b415b3ab
2 changed files with 23 additions and 0 deletions

View File

@@ -148,6 +148,22 @@ function Test_tabpage()
tabonly!
endfunc
func Test_tabpage_drop()
edit f1
tab split f2
tab split f3
normal! gt
call assert_equal(1, tabpagenr())
tab drop f3
call assert_equal(3, tabpagenr())
call assert_equal(1, tabpagenr('#'))
bwipe!
bwipe!
bwipe!
call assert_equal(1, tabpagenr('$'))
endfunc
" Test autocommands
function Test_tabpage_with_autocmd()
command -nargs=1 -bar C :call add(s:li, '=== ' . <q-args> . ' ===')|<args>