Skip to content

Commit ddb70da

Browse files
committed
fix(pick): update CLI tools to not force --no-follow flag
Details: - By default `rg` (and probably `fd`) do not follow links, which is good for performance. So forcing the flag is not needed and is too restrictive for users that *do* want to follow symbolic links via CLI specific config. Resolve #1969
1 parent 0b98576 commit ddb70da

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lua/mini/pick.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,8 +3383,8 @@ H.files_get_tool = function()
33833383
end
33843384

33853385
H.files_get_command = function(tool)
3386-
if tool == 'rg' then return { 'rg', '--files', '--no-follow', '--color=never' } end
3387-
if tool == 'fd' then return { 'fd', '--type=f', '--no-follow', '--color=never' } end
3386+
if tool == 'rg' then return { 'rg', '--files', '--color=never' } end
3387+
if tool == 'fd' then return { 'fd', '--type=f', '--color=never' } end
33883388
if tool == 'git' then return { 'git', 'ls-files', '--cached', '--others', '--exclude-standard' } end
33893389
H.error([[Wrong 'tool' for `files` builtin.]])
33903390
end
@@ -3413,7 +3413,7 @@ end
34133413
H.grep_get_command = function(tool, pattern, globs)
34143414
if tool == 'rg' then
34153415
local res = {
3416-
'rg', '--column', '--line-number', '--no-heading', '--field-match-separator', '\\x00', '--no-follow', '--color=never'
3416+
'rg', '--column', '--line-number', '--no-heading', '--field-match-separator', '\\x00', '--color=never'
34173417
}
34183418
for _, g in ipairs(globs) do
34193419
table.insert(res, '--glob')

tests/test_pick.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,8 +2657,8 @@ T['builtin.files()']['respects `local_opts.tool`'] = function()
26572657
clear_spawn_log()
26582658
end
26592659

2660-
validate('rg', { '--files', '--no-follow' })
2661-
validate('fd', { '--type=f', '--no-follow' })
2660+
validate('rg', { '--files' })
2661+
validate('fd', { '--type=f' })
26622662
validate('git', { 'ls-files', '--cached', '--others' })
26632663
end
26642664

0 commit comments

Comments
 (0)