mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
feat: get rid of "auto" picker and set better defaults for telescope find_files. Fixes #3974
This commit is contained in:
parent
431ceaf329
commit
1bf5f15b26
3 changed files with 13 additions and 22 deletions
|
@ -57,7 +57,7 @@ function M.open(command, opts)
|
|||
return LazyVim.error("LazyVim.pick: picker not set")
|
||||
end
|
||||
|
||||
command = command or "auto"
|
||||
command = command ~= "auto" and command or "files"
|
||||
opts = opts or {}
|
||||
|
||||
opts = vim.deepcopy(opts)
|
||||
|
@ -71,21 +71,6 @@ function M.open(command, opts)
|
|||
opts.cwd = LazyVim.root({ buf = opts.buf })
|
||||
end
|
||||
|
||||
local cwd = opts.cwd or vim.uv.cwd()
|
||||
if command == "auto" then
|
||||
command = "files"
|
||||
if
|
||||
vim.uv.fs_stat(cwd .. "/.git")
|
||||
and not vim.uv.fs_stat(cwd .. "/.ignore")
|
||||
and not vim.uv.fs_stat(cwd .. "/.rgignore")
|
||||
then
|
||||
command = "git_files"
|
||||
if opts.show_untracked == nil then
|
||||
opts.show_untracked = true
|
||||
opts.recurse_submodules = false
|
||||
end
|
||||
end
|
||||
end
|
||||
command = M.picker.commands[command] or command
|
||||
M.picker.open(command, opts)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue