fix(loader): normalize rtp paths on windows #230

This commit is contained in:
Folke Lemaitre 2022-12-29 23:06:37 +01:00
parent 68ee0cbe2d
commit a4bd4dc4a7
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 5 additions and 0 deletions

View File

@ -282,7 +282,12 @@ function M.add_to_rtp(plugin)
local rtp = vim.api.nvim_get_runtime_file("", true)
local idx_dir, idx_after
local is_win = jit.os:find("Windows")
for i, path in ipairs(rtp) do
if is_win then
path = Util.norm(path)
end
if path == Config.me then
idx_dir = i + 1
elseif not idx_after and path:sub(-6, -1) == "/after" then