mirror of
https://github.com/neovim/neovim.git
synced 2026-07-09 10:59:38 +00:00
fix(:checkhealth): open after current tabpage (#40319)
This commit is contained in:
@@ -427,7 +427,7 @@ function M._check(eap)
|
||||
elseif emptybuf then
|
||||
vim.cmd.buffer(bufnr)
|
||||
else
|
||||
vim.cmd.sbuffer { bufnr, mods = { tab = 1 } }
|
||||
vim.cmd.sbuffer { bufnr, mods = { tab = vim.api.nvim_tabpage_get_number(0) } }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ describe(':checkhealth window', function()
|
||||
end)
|
||||
end
|
||||
|
||||
it('opens in tab', function()
|
||||
it('opens in new tabpage after the current one', function()
|
||||
-- create an empty buffer called "my_buff"
|
||||
api.nvim_create_buf(false, true)
|
||||
command('file my_buff')
|
||||
@@ -530,5 +530,16 @@ describe(':checkhealth window', function()
|
||||
]])
|
||||
local buffers_per_tab = fn.CollectBuffersPerTab()
|
||||
eq(buffers_per_tab, { tab1 = { 'my_buff' }, tab2 = { 'health://' } })
|
||||
command('bwipe')
|
||||
command('tab split | tab split | tab split | tabprevious')
|
||||
command('checkhealth success1')
|
||||
buffers_per_tab = fn.CollectBuffersPerTab()
|
||||
eq(buffers_per_tab, {
|
||||
tab1 = { 'my_buff' },
|
||||
tab2 = { 'my_buff' },
|
||||
tab3 = { 'my_buff' },
|
||||
tab4 = { 'health://' },
|
||||
tab5 = { 'my_buff' },
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user