fix(#2081): do not change root for inexistent files (#2082)

This commit is contained in:
Alexander Courtis 2023-03-26 15:05:41 +11:00 committed by GitHub
parent 874b7be5d0
commit 6515a1e1a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,11 @@ function M.change_root(path, bufnr)
end
end
-- don't find inexistent
if vim.fn.filereadable(path) == 0 then
return
end
local cwd = core.get_cwd()
local vim_cwd = vim.fn.getcwd()