fix(cache): normalize paths

This commit is contained in:
Folke Lemaitre 2022-12-20 08:31:19 +01:00
parent bb1c2f4c3e
commit 62c1542141
No known key found for this signature in database
GPG Key ID: 36B7C1C85AAC487F
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,7 @@ end
---@param modpath string
---@return any, string?
function M.loadfile(modpath)
modpath = modpath:gsub("\\", "/")
return M.load(modpath, modpath)
end
@ -106,6 +107,7 @@ end
---@param modpath string
---@return function?, string? error_message
function M.load(modkey, modpath)
modpath = modpath:gsub("\\", "/")
local hash = M.hash(modpath)
if not hash then
-- trigger correct error
@ -167,6 +169,7 @@ function M.get_rtp()
end
end
for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do
path = path:gsub("\\", "/")
if not skip[path] then
M.rtp[#M.rtp + 1] = path
end