fix: error when adding files where root != cwd (#2233)

This commit is contained in:
Avinash Thakur
2025-06-17 13:38:15 +05:30
committed by GitHub
parent 2ed75a2f97
commit b52a89cb08
3 changed files with 27 additions and 32 deletions

View File

@@ -921,6 +921,12 @@ function M.is_absolute_path(path)
return path:match("^/") ~= nil
end
function M.to_absolute_path(path)
if not path or path == "" then return path end
if path:sub(1, 1) == "/" or path:sub(1, 7) == "term://" then return path end
return M.join_paths(M.get_project_root(), path)
end
function M.join_paths(...)
local paths = { ... }
local result = paths[1] or ""