fix(picker): make pick_win work with split layouts. Closes #834

This commit is contained in:
Folke Lemaitre 2025-01-31 19:14:15 +01:00
parent 4c06c24e1b
commit 6dbc26757c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 16 additions and 8 deletions

View file

@ -372,7 +372,8 @@ function M.pick_win(opts)
local chars = "asdfghjkl"
local wins = {} ---@type number[]
for _, win in ipairs(vim.api.nvim_list_wins()) do
if vim.api.nvim_win_get_config(win).relative == "" then
local buf = vim.api.nvim_win_get_buf(win)
if vim.api.nvim_win_get_config(win).relative == "" and not vim.bo[buf].filetype:find("^snacks") then
wins[#wins + 1] = win
end
end