fix(window): respect hide flag of float windows when switching (#30507)

(cherry picked from commit 7b71fdbc1e)
This commit is contained in:
glepnir
2024-09-28 06:02:14 +08:00
committed by github-actions[bot]
parent 9b4e7c9a0d
commit 2f3c447605
3 changed files with 21 additions and 4 deletions

View File

@@ -9021,6 +9021,7 @@ describe('float window', function()
end)
it('float window with hide option', function()
local cwin = api.nvim_get_current_win()
local buf = api.nvim_create_buf(false,false)
local win = api.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true})
local expected_pos = {
@@ -9100,6 +9101,22 @@ describe('float window', function()
|
]])
end
-- check window jump with hide
feed('<C-W><C-W>')
-- should keep on current window
eq(cwin, api.nvim_get_current_win())
api.nvim_win_set_config(win, {hide=false})
api.nvim_set_current_win(win)
local win3 = api.nvim_open_win(buf, true, {relative='editor', width=4, height=4, row=2, col=5, hide = false})
api.nvim_win_set_config(win, {hide=true})
feed('<C-W>w')
-- should goto the first window with prev
eq(cwin, api.nvim_get_current_win())
-- windo
command('windo set winheight=6')
eq(win3, api.nvim_get_current_win())
eq(6, api.nvim_win_get_height(win3))
eq(2, api.nvim_win_get_height(win))
end)
it(':fclose command #9663', function()