feat(zen): make zen/zoom mode work for floating windows. Closes #5028

This commit is contained in:
Folke Lemaitre 2024-12-13 13:37:39 +01:00
parent 12e68a33b5
commit 05bb95739a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -109,8 +109,12 @@ function M.zen(opts)
end
local parent_win = vim.api.nvim_get_current_win()
local parent_zindex = vim.api.nvim_win_get_config(parent_win).zindex
local buf = vim.api.nvim_get_current_buf()
local win_opts = Snacks.win.resolve({ style = "zen" }, opts.win, { buf = buf })
win_opts.zindex = parent_zindex and parent_zindex + 1 or win_opts.zindex
if Snacks.util.is_transparent() and type(win_opts.backdrop) == "table" then
win_opts.backdrop.transparent = false
end