Skip to content

Commit 62c1542

Browse files
committed
fix(cache): normalize paths
1 parent bb1c2f4 commit 62c1542

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/lazy/core/cache.lua

+3
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ end
9999
---@param modpath string
100100
---@return any, string?
101101
function M.loadfile(modpath)
102+
modpath = modpath:gsub("\\", "/")
102103
return M.load(modpath, modpath)
103104
end
104105

105106
---@param modkey string
106107
---@param modpath string
107108
---@return function?, string? error_message
108109
function M.load(modkey, modpath)
110+
modpath = modpath:gsub("\\", "/")
109111
local hash = M.hash(modpath)
110112
if not hash then
111113
-- trigger correct error
@@ -167,6 +169,7 @@ function M.get_rtp()
167169
end
168170
end
169171
for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do
172+
path = path:gsub("\\", "/")
170173
if not skip[path] then
171174
M.rtp[#M.rtp + 1] = path
172175
end

0 commit comments

Comments
 (0)