patch 8.2.1054: not so easy to pass a lua function to Vim
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)
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index 63e227d..170f861 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -333,6 +333,14 @@
: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*