mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 01:21:48 +00:00
vim-patch:9.2.0923: tabpage: closing a tab page loses the alternate tab page (#41229)
Problem: Closing the current tab page resets the alternate tab page, even
when that is another tab page which still exists, so that
CTRL-Tab stops working (igorlfs).
Solution: Restore the last used tab page after entering another one to
close the current one (Hirohito Higashi).
related: vim/vim#20965
closes: vim/vim#20973
a05bd64c1d
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -945,6 +945,23 @@ func Test_lastused_tabpage()
|
||||
tabonly!
|
||||
endfunc
|
||||
|
||||
" Closing a tab page must keep the last used tab page when it is another one.
|
||||
func Test_lastused_tabpage_close()
|
||||
tabonly!
|
||||
tabnew
|
||||
tabnew
|
||||
tabfirst
|
||||
tablast
|
||||
call assert_equal(1, tabpagenr('#'))
|
||||
|
||||
tabclose
|
||||
call assert_equal(1, tabpagenr('#'))
|
||||
call feedkeys("g\<Tab>", "xt")
|
||||
call assert_equal(1, tabpagenr())
|
||||
|
||||
tabonly!
|
||||
endfunc
|
||||
|
||||
" Test for tabpage allocation failure
|
||||
func Test_tabpage_alloc_failure()
|
||||
CheckFunction test_alloc_fail
|
||||
|
||||
Reference in New Issue
Block a user