mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
fix(window): don't go to unfocusable float when closing (#28455)
This commit is contained in:
parent
2088521263
commit
2cbfa4b9af
@ -2869,7 +2869,8 @@ int win_close(win_T *win, bool free_buf, bool force)
|
||||
if (wp == curwin) {
|
||||
break;
|
||||
}
|
||||
if (!wp->w_p_pvw && !bt_quickfix(wp->w_buffer)) {
|
||||
if (!wp->w_p_pvw && !bt_quickfix(wp->w_buffer)
|
||||
&& !(wp->w_floating && !wp->w_config.focusable)) {
|
||||
curwin = wp;
|
||||
break;
|
||||
}
|
||||
|
@ -434,6 +434,25 @@ describe('float window', function()
|
||||
eq(winid, eval('win_getid()'))
|
||||
end)
|
||||
|
||||
it('is not active after closing window when non-focusable #28454', function()
|
||||
command('copen')
|
||||
local winid = exec_lua([[
|
||||
local bufnr = vim.api.nvim_create_buf(false, true)
|
||||
local opts = {
|
||||
relative = 'editor',
|
||||
focusable = false,
|
||||
height = 5,
|
||||
width = 5,
|
||||
col = 5,
|
||||
row = 5,
|
||||
}
|
||||
return vim.api.nvim_open_win(bufnr, false, opts)
|
||||
]])
|
||||
command('wincmd t')
|
||||
command('wincmd q')
|
||||
neq(winid, curwin())
|
||||
end)
|
||||
|
||||
it('supports windo with focusable and non-focusable floats', function()
|
||||
local winids = exec_lua([[
|
||||
local result = {vim.api.nvim_get_current_win()}
|
||||
|
Loading…
Reference in New Issue
Block a user