尝试修复 add file 作为上下文时会找不到文件
Some checks are pending
Lua CI / unit tests (ubuntu-22.04, v0.10.0/nvim-linux64.tar.gz) (push) Waiting to run
Lua CI / Check Lua style (push) Waiting to run
Lua CI / Lint Lua (push) Waiting to run

This commit is contained in:
zhangkun9038@dingtalk.com 2025-02-17 00:15:56 +08:00
parent 11c0d13b9a
commit 24b9daee42
2 changed files with 3 additions and 1 deletions

View File

@ -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()

View File

@ -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()