aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/vim.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r--src/nvim/lua/vim.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index 523d23ec12..820b237c4f 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -255,6 +255,8 @@ function vim.schedule_wrap(cb)
end)
end
+--- <Docs described in |vim.empty_dict()| >
+--@private
function vim.empty_dict()
return setmetatable({}, vim._empty_dict_mt)
end
@@ -270,6 +272,10 @@ vim.fn = setmetatable({}, {
end
})
+vim.funcref = function(viml_func_name)
+ return vim.fn[viml_func_name]
+end
+
-- These are for loading runtime modules lazily since they aren't available in
-- the nvim binary as specified in executor.c
local function __index(t, key)
@@ -286,6 +292,9 @@ local function __index(t, key)
elseif key == 'lsp' then
t.lsp = require('vim.lsp')
return t.lsp
+ elseif key == 'highlight' then
+ t.highlight = require('vim.highlight')
+ return t.highlight
end
end
@@ -462,6 +471,8 @@ end
--- Defers calling `fn` until `timeout` ms passes.
---
--- Use to do a one-shot timer that calls `fn`
+--- Note: The {fn} is |schedule_wrap|ped automatically, so API functions are
+--- safe to call.
--@param fn Callback to call once `timeout` expires
--@param timeout Number of milliseconds to wait before calling `fn`
--@return timer luv timer object