summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/files.lua
diff options
context:
space:
mode:
authorthe continium <thecontinium@outlook.com>2021-06-06 18:39:09 +0100
committerGitHub <noreply@github.com>2021-06-06 19:39:09 +0200
commit4aa45905101b687eb862a90f44f46c91fdd6cc70 (patch)
tree6ac7a652c9c89b24fb1b425ab4559cb61777c4b8 /lua/telescope/builtin/files.lua
parent2697bcfaf0fac861e08c3a55d9334ec6d823029f (diff)
fix: search_dirs in builtin.grep_string (#897)
Diffstat (limited to 'lua/telescope/builtin/files.lua')
-rw-r--r--lua/telescope/builtin/files.lua10
1 files changed, 3 insertions, 7 deletions
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