diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-18 22:25:03 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-08-27 21:19:10 +0200 |
commit | 7df566060c6ca4acbd7b42c1b40adf6058e49982 (patch) | |
tree | 9b5c062db4148909880fa86c4be42a2d35673561 /src/nvim/lua/vim.lua | |
parent | 0a4ef38e430b100b7b91577911c9ebdd3ecde94f (diff) | |
download | rneovim-7df566060c6ca4acbd7b42c1b40adf6058e49982.tar.gz rneovim-7df566060c6ca4acbd7b42c1b40adf6058e49982.tar.bz2 rneovim-7df566060c6ca4acbd7b42c1b40adf6058e49982.zip |
lua/stdlib: cleanup
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r-- | src/nvim/lua/vim.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index 46c96b455f..9854496415 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -8,8 +8,8 @@ -- -- Guideline: "If in doubt, put it in the runtime". -- --- Most functions should live directly on `vim.`, not sub-modules. The only --- "forbidden" names are those claimed by legacy `if_lua`: +-- Most functions should live directly in `vim.`, not in submodules. +-- The only "forbidden" names are those claimed by legacy `if_lua`: -- $ vim -- :lua for k,v in pairs(vim) do print(k) end -- buffer @@ -161,6 +161,16 @@ local function inspect(object, options) -- luacheck: no unused error(object, options) -- Stub for gen_vimdoc.py end +--- Defers the wrapped callback until the Nvim API is safe to call. +--- +--@see |vim-loop-callbacks| +local function schedule_wrap(cb) + return (function (...) + local args = {...} + vim.schedule(function() cb(unpack(args)) end) + end) +end + local function __index(t, key) if key == 'inspect' then t.inspect = require('vim.inspect') @@ -172,16 +182,6 @@ local function __index(t, key) end end ---- Defers the wrapped callback until when the nvim API is safe to call. ---- ---- See |vim-loop-callbacks| -local function schedule_wrap(cb) - return (function (...) - local args = {...} - vim.schedule(function() cb(unpack(args)) end) - end) -end - local module = { _update_package_paths = _update_package_paths, _os_proc_children = _os_proc_children, |