From 4aa45905101b687eb862a90f44f46c91fdd6cc70 Mon Sep 17 00:00:00 2001 From: the continium Date: Sun, 6 Jun 2021 18:39:09 +0100 Subject: fix: search_dirs in builtin.grep_string (#897) --- lua/telescope/builtin/files.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lua') diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index bcc4886..a54f31a 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -107,12 +107,6 @@ files.grep_string = function(opts) local word_match = opts.word_match opts.entry_maker = opts.entry_maker or make_entry.gen_from_vimgrep(opts) - if search_dirs then - for i, path in ipairs(search_dirs) do - search_dirs[i] = vim.fn.expand(path) - end - end - local args = flatten { vimgrep_arguments, word_match, @@ -120,7 +114,9 @@ files.grep_string = function(opts) } if search_dirs then - table.insert(args, search_dirs) + for _, path in ipairs(search_dirs) do + table.insert(args, vim.fn.expand(path)) + end elseif os_sep == '\\' then table.insert(args, '.') end -- cgit v1.2.3