fix(layout): ignore very zindex windows for calulating layout zindex, so that it stays below things like notifications

This commit is contained in:
Folke Lemaitre 2025-11-06 18:25:04 +01:00
parent 6e16c85212
commit 47340e6b0b
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -53,7 +53,10 @@ 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_win or vim.w[win].snacks_layout then
zindex = math.max(zindex, (vim.api.nvim_win_get_config(win).zindex or 0) + 1)
local other = vim.api.nvim_win_get_config(win).zindex or 0
if other < 100 then -- ignore very high zindex windows
zindex = math.max(zindex, other + 1)
end
end
end
self.opts.layout.zindex = zindex + 2