diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-25 19:27:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-25 19:27:56 +0200 |
commit | 801ab069341c8652680d63c174530fd4feb2911e (patch) | |
tree | ff8d365fe4c9ea1dbd5b5918b3a58568a77ec18e /runtime/doc | |
parent | 832adf9bb8cd39d8e982d8a35ed8a6d39b974494 (diff) | |
download | vim-git-801ab069341c8652680d63c174530fd4feb2911e.tar.gz |
patch 8.2.1054: not so easy to pass a lua function to Vimv8.2.1054
Problem: Not so easy to pass a lua function to Vim.
Solution: Convert a Lua function and closure to a Vim funcref. (Prabir
Shrestha, closes #6246)
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/if_lua.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt index 63e227d30..170f861ff 100644 --- a/runtime/doc/if_lua.txt +++ b/runtime/doc/if_lua.txt @@ -333,6 +333,14 @@ Examples: :lua l = d.len -- assign d as 'self' :lua print(l()) < +Lua functions and closures are automatically converted to a Vim |Funcref| and +can be accessed in Vim scripts. Example: +> + lua <<EOF + vim.fn.timer_start(1000, function(timer) + print('timer callback') + end) + EOF ============================================================================== 7. Buffer userdata *lua-buffer* |