mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(window): respect hide flag of float windows when switching (#30507)
This commit is contained in:
parent
09d76afe84
commit
7b71fdbc1e
@ -590,7 +590,7 @@ void ex_listdo(exarg_T *eap)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(wp);
|
assert(wp);
|
||||||
execute = !wp->w_floating || wp->w_config.focusable;
|
execute = !wp->w_floating || (!wp->w_config.hide && wp->w_config.focusable);
|
||||||
if (execute) {
|
if (execute) {
|
||||||
win_goto(wp);
|
win_goto(wp);
|
||||||
if (curwin != wp) {
|
if (curwin != wp) {
|
||||||
|
@ -359,13 +359,13 @@ newwindow:
|
|||||||
wp = lastwin; // wrap around
|
wp = lastwin; // wrap around
|
||||||
}
|
}
|
||||||
while (wp != NULL && wp->w_floating
|
while (wp != NULL && wp->w_floating
|
||||||
&& !wp->w_config.focusable) {
|
&& (wp->w_config.hide || !wp->w_config.focusable)) {
|
||||||
wp = wp->w_prev;
|
wp = wp->w_prev;
|
||||||
}
|
}
|
||||||
} else { // go to next window
|
} else { // go to next window
|
||||||
wp = curwin->w_next;
|
wp = curwin->w_next;
|
||||||
while (wp != NULL && wp->w_floating
|
while (wp != NULL && wp->w_floating
|
||||||
&& !wp->w_config.focusable) {
|
&& (wp->w_config.hide || !wp->w_config.focusable)) {
|
||||||
wp = wp->w_next;
|
wp = wp->w_next;
|
||||||
}
|
}
|
||||||
if (wp == NULL) {
|
if (wp == NULL) {
|
||||||
@ -2851,7 +2851,7 @@ int win_close(win_T *win, bool free_buf, bool force)
|
|||||||
break;
|
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)) {
|
&& !(wp->w_floating && (wp->w_config.hide || !wp->w_config.focusable))) {
|
||||||
curwin = wp;
|
curwin = wp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -9068,6 +9068,7 @@ describe('float window', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('float window with hide option', function()
|
it('float window with hide option', function()
|
||||||
|
local cwin = api.nvim_get_current_win()
|
||||||
local buf = api.nvim_create_buf(false,false)
|
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 win = api.nvim_open_win(buf, false, {relative='editor', width=10, height=2, row=2, col=5, hide = true})
|
||||||
local expected_pos = {
|
local expected_pos = {
|
||||||
@ -9147,6 +9148,22 @@ describe('float window', function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end
|
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)
|
end)
|
||||||
|
|
||||||
it(':fclose command #9663', function()
|
it(':fclose command #9663', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user