From e7a58d94847e6f1b282a6a717794cc454fe51faa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 27 Feb 2024 08:35:41 +0100 Subject: [PATCH] fix(telescope): dont use git_files when .ignore or .rgignore file is present --- lua/lazyvim/util/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 1d816b80..fad24f46 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -24,7 +24,11 @@ function M.telescope(builtin, opts) opts = params.opts opts = vim.tbl_deep_extend("force", { cwd = Util.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] if builtin == "files" then - if vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") then + if + vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") + and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.ignore") + and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.rgignore") + then opts.show_untracked = true builtin = "git_files" else