Skip to content

Commit

Permalink
fix(cache): normalize paths
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2022
1 parent bb1c2f4 commit 62c1542
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ end
---@param modpath string
---@return any, string?
function M.loadfile(modpath)
modpath = modpath:gsub("\\", "/")
return M.load(modpath, modpath)
end

---@param modkey string
---@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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62c1542

Please sign in to comment.