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.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/runtime/lua/vim/loader.lua b/runtime/lua/vim/loader.lua
index 9024bdb231..f340dc85b5 100644
--- a/runtime/lua/vim/loader.lua
+++ b/runtime/lua/vim/loader.lua
@@ -161,7 +161,7 @@ function Loader.read(name)
end
end
---- The `package.loaders` loader for lua files using the cache.
+--- The `package.loaders` loader for Lua files using the cache.
---@param modname string module name
---@return string|function
---@private
@@ -211,7 +211,7 @@ end
---@private
-- luacheck: ignore 312
function Loader.loadfile(filename, mode, env)
- -- ignore mode, since we byte-compile the lua source files
+ -- ignore mode, since we byte-compile the Lua source files
mode = nil
return Loader.load(normalize(filename), { mode = mode, env = env })
end
@@ -268,7 +268,7 @@ function Loader.load(modpath, opts)
return chunk, err
end
---- Finds lua modules for the given module name.
+--- Finds Lua modules for the given module name.
---@param modname string Module name, or `"*"` to find the top-level modules instead
---@param opts? ModuleFindOpts (table|nil) Options for finding a module:
--- - rtp: (boolean) Search for modname in the runtime path (defaults to `true`)
@@ -289,7 +289,7 @@ function M.find(modname, opts)
local idx = modname:find('.', 1, true)
-- HACK: fix incorrect require statements. Really not a fan of keeping this,
- -- but apparently the regular lua loader also allows this
+ -- but apparently the regular Lua loader also allows this
if idx == 1 then
modname = modname:gsub('^%.+', '')
basename = modname:gsub('%.', '/')
@@ -386,9 +386,9 @@ end
--- Enables the experimental Lua module loader:
--- * overrides loadfile
---- * adds the lua loader using the byte-compilation cache
+--- * adds the Lua loader using the byte-compilation cache
--- * adds the libs loader
---- * removes the default Neovim loader
+--- * removes the default Nvim loader
function M.enable()
if M.enabled then
return
@@ -396,11 +396,11 @@ function M.enable()
M.enabled = true
vim.fn.mkdir(vim.fn.fnamemodify(M.path, ':p'), 'p')
_G.loadfile = Loader.loadfile
- -- add lua loader
+ -- add Lua loader
table.insert(loaders, 2, Loader.loader)
-- add libs loader
table.insert(loaders, 3, Loader.loader_lib)
- -- remove Neovim loader
+ -- remove Nvim loader
for l, loader in ipairs(loaders) do
if loader == vim._load_package then
table.remove(loaders, l)
@@ -411,7 +411,7 @@ end
--- Disables the experimental Lua module loader:
--- * removes the loaders
---- * adds the default Neovim loader
+--- * adds the default Nvim loader
function M.disable()
if not M.enabled then
return
@@ -426,8 +426,8 @@ function M.disable()
table.insert(loaders, 2, vim._load_package)
end
---- Return the top-level `/lua/*` modules for this path
----@param path string path to check for top-level lua modules
+--- Return the top-level \`/lua/*` modules for this path
+---@param path string path to check for top-level Lua modules
---@private
function Loader.lsmod(path)
if not Loader._indexed[path] then