mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
fix(float): properly find last window of tabpage (#30571)
This commit is contained in:
parent
006323dd70
commit
df915f3afc
@ -59,7 +59,7 @@ win_T *win_new_float(win_T *wp, bool last, WinConfig fconfig, Error *err)
|
|||||||
if (!tp) {
|
if (!tp) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
tp_last = tp->tp_lastwin;
|
tp_last = tp == curtab ? lastwin : tp->tp_lastwin;
|
||||||
while (tp_last->w_floating && tp_last->w_prev) {
|
while (tp_last->w_floating && tp_last->w_prev) {
|
||||||
tp_last = tp_last->w_prev;
|
tp_last = tp_last->w_prev;
|
||||||
}
|
}
|
||||||
|
@ -662,6 +662,22 @@ describe('float window', function()
|
|||||||
screen:detach()
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('no crash with relative="win" after %bdelete #30569', function()
|
||||||
|
exec([[
|
||||||
|
botright vsplit
|
||||||
|
%bdelete
|
||||||
|
]])
|
||||||
|
api.nvim_open_win(0, false, {
|
||||||
|
relative = 'win',
|
||||||
|
win = 0,
|
||||||
|
row = 0,
|
||||||
|
col = 5,
|
||||||
|
width = 5,
|
||||||
|
height = 5,
|
||||||
|
})
|
||||||
|
assert_alive()
|
||||||
|
end)
|
||||||
|
|
||||||
describe('with only one tabpage,', function()
|
describe('with only one tabpage,', function()
|
||||||
local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1}
|
local float_opts = {relative = 'editor', row = 1, col = 1, width = 1, height = 1}
|
||||||
local old_buf, old_win
|
local old_buf, old_win
|
||||||
|
Loading…
Reference in New Issue
Block a user