mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-27 19:28:59 +02:00
fix(pick): get rid of "auto" picker and set better defaults for telescope find_files (#4024)
## Description Changes telescope's `find_files` options to match `fzf-lua` that matches what `git_files` does including untracked files. ## Related Issue(s) Fixes #3974 ## Screenshots <!-- Add screenshots of the changes if applicable. --> ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
This commit is contained in:
parent
065d72320d
commit
337e9ddc00
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