Closed nyngwang closed 1 year ago
Good news: just found a workaround that always work:
require('neo-zoom').setup {
-- many options omitted.
callbacks = {
function ()
if vim.wo.winhl == '' then vim.wo.winhl = 'Normal:' end -- this is the key.
end,
-- many callbacks omitted.
}
} -- end of `setup`
-- define the companion `autocmd` for this effect.
vim.api.nvim_create_autocmd({ 'WinEnter' }, {
group = curfile_augroup,
callback = function ()
local did_zoom = require('neo-zoom').did_zoom()
if not did_zoom[1] then return end
-- wait for upstream: https://github.com/neovim/neovim/issues/23542.
if vim.api.nvim_get_current_win() == did_zoom[2]
then vim.api.nvim_win_set_option(did_zoom[2], 'winbl', 0)
else vim.api.nvim_win_set_option(did_zoom[2], 'winbl', 20) end
end
})
This can be closed once https://github.com/neovim/neovim/pull/23555 is merged upstream.
Maybe I should enable this by default if the user might jump out of the zoom-in window. This way they can, to some degree, see the buffer behind the floating window.
effect preview: