fix(fzf): correctly pass opts.cwd when root=false

This commit is contained in:
Iordanis Petkakis 2024-06-11 10:30:18 +03:00
parent fe667b53c9
commit 76c5ee408f

View file

@ -34,13 +34,13 @@ function M.open(command, opts)
opts.cwd = LazyVim.root({ buf = opts.buf }) opts.cwd = LazyVim.root({ buf = opts.buf })
end end
local cwd = opts.cwd or vim.uv.cwd() opts.cwd = opts.cwd or vim.uv.cwd()
if command == "auto" then if command == "auto" then
command = "files" command = "files"
if if
vim.uv.fs_stat(cwd .. "/.git") vim.uv.fs_stat(opts.cwd .. "/.git")
and not vim.uv.fs_stat(cwd .. "/.ignore") and not vim.uv.fs_stat(opts.cwd .. "/.ignore")
and not vim.uv.fs_stat(cwd .. "/.rgignore") and not vim.uv.fs_stat(opts.cwd .. "/.rgignore")
then then
command = "git_files" command = "git_files"
opts.show_untracked = opts.show_untracked ~= false opts.show_untracked = opts.show_untracked ~= false