diff options
Diffstat (limited to 'lua/telescope/builtin.lua')
| -rw-r--r-- | lua/telescope/builtin.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index afc104c..d207b99 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -246,6 +246,8 @@ end builtin.fd = function(opts) + opts = opts or {} + local fd_string = nil if 1 == vim.fn.executable("fd") then fd_string = "fd" @@ -258,9 +260,23 @@ builtin.fd = function(opts) return end + -- TODO: CWD not 100% supported at this moment. + -- Previewers don't work. We'll have to try out something for that later + local cwd = opts.cwd + if cwd then + cwd = vim.fn.expand(cwd) + end + pickers.new(opts, { prompt = 'Find Files', - finder = finders.new_oneshot_job {fd_string}, + finder = finders.new { + fn_command = function() + return { + command = fd_string, + cwd = cwd, + } + end, + }, previewer = previewers.cat, sorter = sorters.get_fuzzy_file(), }):find() |
