fix(picker.config): normalize opts.cwd

This commit is contained in:
Folke Lemaitre 2025-01-30 10:39:34 +01:00
parent 5a8d79847b
commit 69c013e1b2

View file

@ -77,8 +77,10 @@ function M.get(opts)
-- Merge the configs
opts = Snacks.config.merge(unpack(todo))
if opts.cwd == true then
if opts.cwd == true or opts.cwd == "" then
opts.cwd = nil
elseif opts.cwd then
opts.cwd = vim.fs.normalize(vim.fn.fnamemodify(opts.cwd, ":p"))
end
M.multi(opts)
return opts