feat(sidebar): support files outside of the current working directory. (#1065)

This commit is contained in:
Christopher Brewin
2025-01-12 01:15:13 +10:00
committed by GitHub
parent 24641d8264
commit f401983737
4 changed files with 24 additions and 3 deletions

View File

@@ -826,6 +826,7 @@ function M.get_current_selection_diagnostics(bufnr, selection)
end
function M.uniform_path(path)
if not M.file.is_in_cwd(path) then return path end
local project_root = M.get_project_root()
local abs_path = Path:new(project_root):joinpath(path):absolute()
local relative_path = Path:new(abs_path):make_relative(project_root)