Conversation
|
Thanks. How about also updating the tests in |
|
Added tests. How do I only run that file or function for test. |
|
Hi,
On Sun, May 10, 2020 at 11:57 AM Prabir Shrestha ***@***.***> wrote:
Added tests. How do I only run that file or function for test.
In your local view, you can run the following command to run all the tests
in the test_lua.vim file (for a Linux/Unix/MacOS system):
$ cd testdir
$ make test_lua
To run only the Test_lua_has() test function:
$ cd testdir
$ ../vim -u NONE -S runtest.vim test_lua.vim Test_lua_has
- Yegappan
|
|
Getting test failures since |
|
Updated to return boolean for lua instead of number. Fixed the tests. |
|
Neovim is doing a lot with Lua, don't they have this? |
|
@justinmk Any idea if neovim already include Neovim has function! CurrentLineInfo()
lua << EOF
local linenr = vim.api.nvim_win_get_cursor(0)[1]
local curline = vim.api.nvim_buf_get_lines(
0, linenr, linenr + 1, false)[1]
print(string.format("Current line [%d] has %d bytes",
linenr, #curline))
EOF
endfunctionI'm planning to add few more functions in lua primarily for use in asyncomplete.vim for perf. Given that it is very small and easy to port goal is to have both vimscript and lua port of the plugin but if it has lua support I want to avoid the plugin to use vimscript at all and viceversa. @brammool @justinmk Would you instead prefer me to send a PR with only doc changes so we can discuss on just the apis and do the actual implementation separately. One thing to note is that neovim exposes the entire local luv = require('luv')
luv.sleep(1000)Primary reason for starting the doc PR is I want to have some high level apis such as local timer = vim.loop.new_timer()
timer:start(1000, 0, vim.schedule_wrap(function()
vim.api.nvim_command('echomsg "test"')
end)) |
You can call If you use Nvim-HEAD version( > v0.4.3), you can use
EDITED |
|
@h-michael That is great. I think it would be good to officially bring My JavaScript PR support also had similar @h-michael Do you know how neovim deals with float vs number. I had issues with @brammool What are your thoughts on this? |
|
closing in favor of #6063. |
Feature detection is a must in order to support backwards compatibility. Was writing a plugin in lua and noticed that it is currently not possible to support it without
eval.Signature is the same as vim's
has()function.