From d48a2933d55a5aa2ca3c15e482a90bbffbb49b92 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 2 Sep 2020 19:11:38 -0400 Subject: fix: clear last line --- lua/telescope/builtin.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'lua/telescope/builtin.lua') 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() -- cgit v1.2.3