From 24b9daee42454babe7a6a595d16577e9e748d656 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Mon, 17 Feb 2025 00:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=20add=20fi?= =?UTF-8?q?le=20=E4=BD=9C=E4=B8=BA=E4=B8=8A=E4=B8=8B=E6=96=87=E6=97=B6?= =?UTF-8?q?=E4=BC=9A=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/avante/file_selector.lua | 1 + lua/avante/utils/root.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/avante/file_selector.lua b/lua/avante/file_selector.lua index 4af6ac6..ac4d278 100644 --- a/lua/avante/file_selector.lua +++ b/lua/avante/file_selector.lua @@ -58,6 +58,7 @@ end local function get_project_filepaths() local project_root = Utils.get_project_root() + print("project_root:", project_root) local files = Utils.scan_directory_respect_gitignore({ directory = project_root, add_dirs = true }) files = vim.iter(files):map(function(filepath) return Path:new(filepath):make_relative(project_root) end):totable() diff --git a/lua/avante/utils/root.lua b/lua/avante/utils/root.lua index 61aa057..e882567 100644 --- a/lua/avante/utils/root.lua +++ b/lua/avante/utils/root.lua @@ -140,7 +140,8 @@ function M.get(opts) ret = ret ~= "" and ret or vim.uv.cwd() print("Final Root:", ret) - return Utils.is_win() and ret:gsub("/", "\\") or ret + --- return Utils.is_win() and ret:gsub("/", "\\") or ret + return ret end function M.git()