fix(layout): make sure new windows created by a layout are top-level

This commit is contained in:
Folke Lemaitre 2025-11-01 11:15:38 +01:00
parent 25d93c3571
commit b0b12a656f
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -52,12 +52,7 @@ function M.new(opts)
local zindex = self.opts.layout.zindex or 50
for _, win in ipairs(vim.api.nvim_list_wins()) do
if vim.w[win].snacks_layout then
local winc = vim.api.nvim_win_get_config(win)
if winc.zindex and winc.zindex >= zindex then
zindex = winc.zindex + 1
end
end
zindex = math.max(zindex, (vim.api.nvim_win_get_config(win).zindex or 0) + 1)
end
self.opts.layout.zindex = zindex + 2