diff options
| author | Luke Kershaw <35707277+l-kershaw@users.noreply.github.com> | 2021-07-13 19:16:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-13 19:16:50 +0100 |
| commit | 999fad2ce514d869b736aa5d948d355fad89be8d (patch) | |
| tree | 633ef0cf443bb205070cf70c48307334ac5a19d1 | |
| parent | 5692edd004fed1dbd55c90775c34a051298724e7 (diff) | |
feat: add Windows `where` file finder command (#979)
| -rw-r--r-- | lua/telescope/builtin/files.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index 29c8df5..5c36963 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -7,6 +7,7 @@ local pickers = require('telescope.pickers') local previewers = require('telescope.previewers') local utils = require('telescope.utils') local conf = require('telescope.config').values +local log = require('telescope.log') local scan = require('plenary.scandir') local Path = require('plenary.path') @@ -173,7 +174,7 @@ files.find_files = function(opts) table.insert(find_command, v) end end - elseif 1 == vim.fn.executable("find") then + elseif 1 == vim.fn.executable("find") and not vim.fn.has('win32') then find_command = { 'find', '.', '-type', 'f' } if not hidden then table.insert(find_command, { '-not', '-path', "*/.*" }) @@ -186,6 +187,17 @@ files.find_files = function(opts) table.insert(find_command, 2, v) end end + elseif 1 == vim.fn.executable("where") then + find_command = { 'where', '/r', '.', '*'} + if hidden ~= nil then + log.warn('The `hidden` key is not available for the Windows `where` command in `find_files`.') + end + if follow ~= nil then + log.warn('The `follow` key is not available for the Windows `where` command in `find_files`.') + end + if search_dirs ~= nil then + log.warn('The `search_dirs` key is not available for the Windows `where` command in `find_files`.') + end end end |
