fix(vim.fs): root() should always return absolute path #36466

(cherry picked from commit f11f8546e7)
This commit is contained in:
Cameron Ring
2025-11-16 21:41:26 -08:00
committed by github-actions[bot]
parent a6bc5780ac
commit d974c684da
2 changed files with 10 additions and 1 deletions

View File

@@ -441,7 +441,8 @@ function M.root(source, marker)
})
if #paths ~= 0 then
return vim.fs.dirname(paths[1])
local dir = vim.fs.dirname(paths[1])
return dir and vim.fn.fnamemodify(dir, ':p:h') or nil
end
end