add vim.call() for lua and vim.fn.*#6063
Conversation
|
During the plan for Vim9, @brammool declared that the legacy interfaces (lua, tcl, python, etc.) in Vim were deprecated. Did that change? |
|
Justin M. Keyes wrote:
During the plan for Vim9, @brammool declared that the legacy
interfaces (lua, tcl, python, etc.) in Vim were deprecated. Did that
change?
No change. It doesn't mean no more changes are allowed, just that it's
less likely more work will be done. But if someone sends a good patch,
why not include it.
I also think the Python tests should be rewritten, they are quite hard
to understand and sometimes break.
…--
From "know your smileys":
:-{} Too much lipstick
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
What makes it less likely? |
|
@brammool I have updated the PR with tests and docs so should be good for review. Let me know if I'm missing anything else. Few things to note: |
|
Thanks. I'll include this. If more changes are desirable for plugin writers that use Lua I hope someone can pick that up. |
Based on #6056 (comment) neovim > v0.5.0 will have support for
vim.fnwhich is already in their master.There are two new apis exposed to lua interface i.e.
vim.callandvim.fn.:lua print(vim.call('has', 'nvim')):lua vim.fn.has('nvim')vim.callvim.fnvim.callvim.fnAdditional features that can be done in different PR:
timer_stopwhich only takes integer doesn't work. neovim seems to handle it correctly already.luaV_totypvalneeds to be able to convert lua functions to vimfunc. This will allow us to use functions such astimer_startwhich takes in function.