Skip to content

Commit 69e40ab

Browse files
committed
fix: search user config when cwd is nvim config path.
1 parent 5799999 commit 69e40ab

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lua/modules/configs/tool/search.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
return function()
22
local builtin = require("telescope.builtin")
33
local extensions = require("telescope").extensions
4+
local vim_path = require("core.global").vim_path
45

56
require("modules.utils").load_plugin("search", {
67
collections = {
@@ -12,7 +13,9 @@ return function()
1213
name = "Files",
1314
tele_func = function(opts)
1415
opts = opts or {}
15-
if vim.fn.isdirectory(".git") == 1 then
16+
if vim.fn.getcwd() == vim_path then
17+
builtin.find_files(vim.tbl_deep_extend("force", opts, { no_ignore = true }))
18+
elseif vim.fn.isdirectory(".git") == 1 then
1619
builtin.git_files(opts)
1720
else
1821
builtin.find_files(opts)
@@ -46,13 +49,20 @@ return function()
4649
{
4750
name = "Word in project",
4851
tele_func = function()
49-
extensions.live_grep_args.live_grep_args()
52+
local opts = {}
53+
if vim.fn.getcwd() == vim_path then
54+
opts["additional_args"] = { "--no-ignore" }
55+
end
56+
extensions.live_grep_args.live_grep_args(opts)
5057
end,
5158
},
5259
{
5360
name = "Word under cursor",
5461
tele_func = function(opts)
5562
opts = opts or {}
63+
if vim.fn.getcwd() == vim_path then
64+
opts["additional_args"] = { "--no-ignore" }
65+
end
5666
builtin.grep_string(opts)
5767
end,
5868
},

0 commit comments

Comments
 (0)