mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
fix(health): normalize paths when checking runtimepath
This commit is contained in:
parent
7caec274fd
commit
57a2b8e3e1
1 changed files with 12 additions and 1 deletions
|
|
@ -20,6 +20,17 @@ local function check_exe(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param dir string
|
||||||
|
---@return boolean
|
||||||
|
local function check_runtimepath(dir)
|
||||||
|
for _, rtp in ipairs(vim.api.nvim_list_runtime_paths()) do
|
||||||
|
if vim.fs.normalize(rtp) == vim.fs.normalize(dir) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local function install_health()
|
local function install_health()
|
||||||
health.start('Requirements')
|
health.start('Requirements')
|
||||||
|
|
||||||
|
|
@ -95,7 +106,7 @@ local function install_health()
|
||||||
else
|
else
|
||||||
health.error('is not writable.')
|
health.error('is not writable.')
|
||||||
end
|
end
|
||||||
if vim.list_contains(vim.api.nvim_list_runtime_paths(), installdir) then
|
if check_runtimepath(installdir) then
|
||||||
health.ok('is in runtimepath.')
|
health.ok('is in runtimepath.')
|
||||||
else
|
else
|
||||||
health.error('is not in runtimepath.')
|
health.error('is not in runtimepath.')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue