From 76c5ee408f257229acf7786be94b9fdf253c5a0e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:30:18 +0300 Subject: [PATCH] fix(fzf): correctly pass `opts.cwd` when `root=false` --- lua/lazyvim/util/pick.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 30160215..e210eb78 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -34,13 +34,13 @@ function M.open(command, opts) opts.cwd = LazyVim.root({ buf = opts.buf }) end - local cwd = opts.cwd or vim.uv.cwd() + opts.cwd = opts.cwd or vim.uv.cwd() if command == "auto" then command = "files" if - vim.uv.fs_stat(cwd .. "/.git") - and not vim.uv.fs_stat(cwd .. "/.ignore") - and not vim.uv.fs_stat(cwd .. "/.rgignore") + vim.uv.fs_stat(opts.cwd .. "/.git") + and not vim.uv.fs_stat(opts.cwd .. "/.ignore") + and not vim.uv.fs_stat(opts.cwd .. "/.rgignore") then command = "git_files" opts.show_untracked = opts.show_untracked ~= false