fix(snacks.picker): flash with 2 snacks windows open

This commit is contained in:
Iordanis Petkakis 2026-05-26 17:52:23 +03:00
parent fa88241e2f
commit 9f77a2a350

View file

@ -246,6 +246,14 @@ return {
mode = "search",
exclude = {
function(win)
local source = picker.opts.source ~= "explorer" and picker.opts.source or nil
local snacks_explorer = require("snacks").picker.get({ source = "explorer" })[1]
local snacks_picker = source and require("snacks").picker.get({ source = source })[1]
local picker_win = snacks_picker and snacks_picker.layout.wins["list"].win
if snacks_explorer and snacks_picker then
return win ~= picker_win
end
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list"
end,
},