diff options
| author | TimUntersberger <32014449+TimUntersberger@users.noreply.github.com> | 2020-09-14 00:13:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-13 18:13:46 -0400 |
| commit | 0a734ae49d166a56e4f02295ee97508180160491 (patch) | |
| tree | 542080aba70ce2b343561cf08aa74a91befb64fc /lua | |
| parent | 3d423a3b592ab49cbe89a4bf88d2cab6bd663509 (diff) | |
feat: add find_command option for find_files (#73)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index db29316..36a585c 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -366,13 +366,16 @@ end builtin.find_files = function(opts) opts = opts or {} - local find_command = nil - if 1 == vim.fn.executable("fd") then - find_command = { 'fd', '--type', 'f' } - elseif 1 == vim.fn.executable("fdfind") then - find_command = { 'fdfind', '--type', 'f' } - elseif 1 == vim.fn.executable("rg") then - find_command = { 'rg', '--files' } + local find_command = opts.find_command + + if not find_command then + if 1 == vim.fn.executable("fd") then + find_command = { 'fd', '--type', 'f' } + elseif 1 == vim.fn.executable("fdfind") then + find_command = { 'fdfind', '--type', 'f' } + elseif 1 == vim.fn.executable("rg") then + find_command = { 'rg', '--files' } + end end if not find_command then |
