From 161153efae5b0d53410a286ffa386d98cce00275 Mon Sep 17 00:00:00 2001 From: ayamir Date: Sun, 5 Jan 2025 00:44:42 +0800 Subject: [PATCH] fix: search user config when cwd is nvim config path. --- lua/modules/configs/tool/search.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index ffad69cbc..d0ff7811b 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -1,6 +1,7 @@ return function() local builtin = require("telescope.builtin") local extensions = require("telescope").extensions + local vim_path = require("core.global").vim_path require("modules.utils").load_plugin("search", { collections = { @@ -12,7 +13,9 @@ return function() name = "Files", tele_func = function(opts) opts = opts or {} - if vim.fn.isdirectory(".git") == 1 then + if vim.fn.getcwd() == vim_path then + builtin.find_files(vim.tbl_deep_extend("force", opts, { no_ignore = true })) + elseif vim.fn.isdirectory(".git") == 1 then builtin.git_files(opts) else builtin.find_files(opts)