diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-08-25 22:01:35 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-10-27 17:23:17 +0100 |
commit | 8ee7c94a92598d46b488b7fe3b1a5cff6b1bf94a (patch) | |
tree | a8f7d0b4fd659c93d2b1470e6ba6ef751eae4de9 /runtime | |
parent | 19ba36d0e1bb4ef28f8aa92c7386345fbcf78cf2 (diff) | |
download | rneovim-8ee7c94a92598d46b488b7fe3b1a5cff6b1bf94a.tar.gz rneovim-8ee7c94a92598d46b488b7fe3b1a5cff6b1bf94a.tar.bz2 rneovim-8ee7c94a92598d46b488b7fe3b1a5cff6b1bf94a.zip |
lua: add vim.fn.{func} for direct access to vimL function
compared to vim.api.|nvim_call_function|, this fixes some typing issues
due to the indirect conversion via the API. float values are preserved
as such (fixes #9389) as well as empty dicts/arrays.
Ref https://github.com/norcalli/nvim.lua for the call syntax
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/if_lua.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 8528085f47..d527a91a93 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -588,6 +588,22 @@ vim.schedule({callback}) *vim.schedule()* Schedules {callback} to be invoked soon by the main event-loop. Useful to avoid |textlock| or other temporary restrictions. +vim.fn.{func}({...}) + Call vimL function {func} with arguments. {func} can be both builtin + functions and user functions. To call autoload functions, use the + syntax `vim.fn['some#function']({...})` + + Note: unlike vim.api.|nvim_call_function| this converts values directly + between vimL values and lua values. If the vimL function returns a + float, it will be representeted directly as a lua number. Both empty + lists and dictonaries will be represented by an empty table. + + Note: vim.fn keys are generated on demand. So `pairs(vim.fn)` + does NOT work to enumerate all functions. + +vim.call({func}, {...}) + Call vim script function {func}. Equivalent to `vim.fn[func]({...})` + vim.type_idx *vim.type_idx* Type index for use in |lua-special-tbl|. Specifying one of the values from |vim.types| allows typing the empty table (it is |