mirror of
https://github.com/neovim/neovim.git
synced 2026-08-01 13:19:20 +00:00
fix(window): yeet grid later when closing float in other tabpage #40758
Problem: #40731 may still crash if close_buffer autocmds reinsert the float's
grid. Plus removing the grid (and posting win_close) is unneeded if
win_close_othertab refuses to close the window later, which is possible.
Solution: do the stuff before freeing the window, like win_close.
(cherry picked from commit 1741da8412)
This commit is contained in:
committed by
github-actions[bot]
parent
3a0e6239e9
commit
fa3a0a7feb
@@ -10460,12 +10460,22 @@ describe('float window', function()
|
||||
it('no crash when closing a floating window from a non-current tab', function()
|
||||
local buf = api.nvim_create_buf(false, true)
|
||||
local win = api.nvim_open_win(buf, false, { relative = 'editor', width = 5, height = 5, row = 0, col = 0 })
|
||||
exec_lua(function()
|
||||
local triggered = exec_lua(function()
|
||||
vim.cmd.tabnew()
|
||||
vim.api.nvim_win_call(win, vim.cmd.redraw)
|
||||
local triggered = false
|
||||
vim.api.nvim_create_autocmd('BufHidden', {
|
||||
once = true,
|
||||
buf = buf,
|
||||
callback = function()
|
||||
vim.api.nvim_win_call(win, vim.cmd.redraw)
|
||||
triggered = true
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_win_close(win, true)
|
||||
return triggered
|
||||
end)
|
||||
api.nvim_win_close(win, true)
|
||||
assert_alive()
|
||||
eq(true, triggered)
|
||||
end)
|
||||
|
||||
it(':sleep cursor placement #22639', function()
|
||||
|
||||
Reference in New Issue
Block a user