aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/loader.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/loader.lua')
-rw-r--r--runtime/lua/vim/loader.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/loader.lua b/runtime/lua/vim/loader.lua
index 4f4722b0c3..e08ccba701 100644
--- a/runtime/lua/vim/loader.lua
+++ b/runtime/lua/vim/loader.lua
@@ -1,4 +1,5 @@
local uv = vim.uv
+local uri_encode = vim.uri_encode
--- @type (fun(modename: string): fun()|string)[]
local loaders = package.loaders
@@ -33,7 +34,7 @@ M.enabled = false
---@field _rtp_key string
---@field _hashes? table<string, CacheHash>
local Loader = {
- VERSION = 3,
+ VERSION = 4,
---@type table<string, table<string,ModuleInfo>>
_indexed = {},
---@type table<string, string[]>
@@ -99,7 +100,7 @@ end
---@return string file_name
---@private
function Loader.cache_file(name)
- local ret = M.path .. '/' .. name:gsub('[/\\:]', '%%')
+ local ret = ('%s/%s'):format(M.path, uri_encode(name, 'rfc2396'))
return ret:sub(-4) == '.lua' and (ret .. 'c') or (ret .. '.luac')
end