patch 8.2.0775: not easy to call a Vim function from Lua

Problem:    Not easy to call a Vim function from Lua.
Solution:   Add vim.call() and vim.fn(). (Prabir Shrestha, closes #6063)
This commit is contained in:
Bram Moolenaar
2020-05-17 14:32:35 +02:00
parent 26e86445bf
commit eb04f0893a
4 changed files with 118 additions and 22 deletions

View File

@ -199,6 +199,15 @@ Vim evaluation and command execution, and others.
returns it. Note that the buffer is not set as
current.
vim.call({name} [,{args}])
Proxy to call Vim function named {name} with
arguments {args}. Example: >
:lua print(vim.call('has', 'timers'))
<
vim.fn Proxy to call Vim functions. Proxy methods are
created on demand. Example: >
:lua print(vim.fn.has('timers'))
<
==============================================================================
3. List userdata *lua-list*