fix(picker.actions): take into account if source is recent explicitly

This commit is contained in:
Iordanis Petkakis 2025-05-26 22:32:58 +03:00
parent bc0630e43b
commit 97167483e7

View file

@ -266,12 +266,23 @@ function M.picker(picker, item, action)
for _, p in ipairs(Snacks.picker.get({ source = source })) do
p:close()
end
Snacks.picker(source, {
cwd = Snacks.picker.util.dir(item),
on_show = function()
picker:close()
end,
})
if source == "recent" then
Snacks.picker(source, {
filter = {
cwd = Snacks.picker.util.dir(item),
},
on_show = function()
picker:close()
end,
})
else
Snacks.picker(source, {
cwd = Snacks.picker.util.dir(item),
on_show = function()
picker:close()
end,
})
end
end
M.picker_files = { action = "picker", source = "files" }