From 313ce9d0b6fb3bdb5ee07af60ee8840bdd4fbf73 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Mon, 4 Jan 2021 22:01:03 +0100 Subject: fix: live_grep will now accept cwd (#390) --- lua/telescope/builtin/files.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lua/telescope/builtin/files.lua') diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index d8175e2..9d26a4a 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -23,6 +23,10 @@ local escape_chars = function(string) end files.live_grep = function(opts) + if opts.cwd then + opts.cwd = vim.fn.expand(opts.cwd) + end + local live_grepper = finders.new_job(function(prompt) -- TODO: Probably could add some options for smart case and whatever else rg offers. @@ -35,7 +39,8 @@ files.live_grep = function(opts) return flatten { conf.vimgrep_arguments, prompt } end, opts.entry_maker or make_entry.gen_from_vimgrep(opts), - opts.max_results + opts.max_results, + opts.cwd ) pickers.new(opts, { -- cgit v1.2.3