mirror of
https://github.com/neovim/neovim.git
synced 2026-04-23 07:45:32 +00:00
fix(pack): close confirmation buffer, not tabpage #37756
This commit is contained in:
committed by
GitHub
parent
6cb3254c2f
commit
0f73873d4f
@@ -1372,25 +1372,31 @@ describe('vim.pack', function()
|
||||
local other_tabpage = api.nvim_get_current_tabpage()
|
||||
n.exec('tabnext')
|
||||
n.exec('write')
|
||||
eq(true, api.nvim_tabpage_is_valid(other_tabpage))
|
||||
eq(true, api.nvim_get_current_tabpage() == other_tabpage)
|
||||
eq(false, api.nvim_tabpage_is_valid(confirm_tabpage))
|
||||
|
||||
-- Not confirm with `:quit`
|
||||
n.exec('tab split other-tab-2')
|
||||
local other_tabpage_2 = api.nvim_get_current_tabpage()
|
||||
exec_lua(function()
|
||||
vim.pack.update()
|
||||
end)
|
||||
exec_lua('vim.pack.update()')
|
||||
confirm_tabpage = api.nvim_get_current_tabpage()
|
||||
|
||||
-- - Temporary split window in tabpage should not matter
|
||||
-- - Temporary split window in tabpage should prevent from closing
|
||||
n.exec('vsplit other-buf')
|
||||
n.exec('wincmd w')
|
||||
|
||||
n.exec('tabclose ' .. api.nvim_tabpage_get_number(other_tabpage_2))
|
||||
eq(confirm_tabpage, api.nvim_get_current_tabpage())
|
||||
n.exec('quit')
|
||||
eq(confirm_tabpage, api.nvim_get_current_tabpage())
|
||||
n.exec('quit')
|
||||
eq(false, api.nvim_tabpage_is_valid(confirm_tabpage))
|
||||
|
||||
-- Should work even if it is the last tabpage
|
||||
exec_lua('vim.pack.update()')
|
||||
n.exec('tabonly')
|
||||
n.exec('write')
|
||||
eq('', n.eval('v:errmsg'))
|
||||
end)
|
||||
|
||||
it('has in-process LSP features', function()
|
||||
|
||||
Reference in New Issue
Block a user