aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/luaeval_spec.lua
Commit message (Collapse)AuthorAge
* test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque2023-05-22
| | | | `nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)zeertzjq2023-04-16
| | | | | | | | Problem: Vim9: exception in ISN_INSTR caught at wrong level. Solution: Set the starting trylevel in exec_instructions(). (closes vim/vim#8214) https://github.com/vim/vim/commit/ff65288aa89dcd50760ad942d58baff70c6e93e6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3783: confusing error for using a variable as a functionzeertzjq2023-04-16
| | | | | | | | | | Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(eval): check for v:lua when calling callback (#19855)zeertzjq2022-08-20
| | | This makes callback_call() match call_vim_function() when calling a function.
* fix(eval): v:lua support for `-` in module namesbb010g2022-01-28
|
* feat(lua): enable stack traces in error output (#16228)Gregory Anders2021-11-06
|
* feat(lua): document support of packages with v:lua syntaxBjörn Linse2021-10-23
| | | | this already worked in 0.5 but was not properly documented or tested
* feat(eval/method): partially port v8.1.1954Sean Dewar2021-10-03
| | | | | | | | | | | Does not include listener_*() functions. js_*() functions are N/A. json_encode() and json_decode() didn't include tests; add some anyway (to json_functions_spec.lua). test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
* feat(decode_string): decode binary string with NULs to BlobSean Dewar2021-09-15
| | | | | | | | Strings that previously decoded into a msgpack special for representing BINs with NULs now convert to Blobs. It shouldn't be possible to decode into this special anymore after this change? Notably, Lua strings with NULs now convert to Blobs when passed to VimL.
* feat(nlua): convert Blobs to stringsSean Dewar2021-09-15
|
* feat(v:lua): support calling v:lua as a methodSean Dewar2021-08-13
|
* fix(v:lua): fix emsg when calling v:lua directlySean Dewar2021-08-12
| | | | | | | | | | v:lua expressions are represented using vvlua_partial. As v:lua isn't intended to be called directly, it's given an empty pt_name. Because of this, calling v:lua directly like "v:lua()" will cause "E117: Unknown function: ", with an empty name. Instead, have call_func() show the name "v:lua" in the emsg.
* test/vim.validate(): assert normalized stacktraceJustin M. Keyes2020-10-05
| | | | | | | - The previous commit lost information in the tests. Instead, add some more "normalization" substitutions in pcall_err(), so that the general shape of the stacktrace is included in the asserted text. - Eliminate contains(), it is redundant with matches()
* lua: Fix crash on unprotected lua errors (#12658)TJ DeVries2020-07-19
| | | | | | | | | | | | | | | | | | Can be reproduced with a script like this: -- in some lua file vim.fn.timer_start(10, function() error("uh....") end) -- will cause neovim to crash with the following error. PANIC: unprotected error in call to Lua API (nlua_CFunction_func_call failed.) After this, it will instead print the error message from the top of the stack, like so. tmp/error_nvim.lua:10: uh... Also added an example test. Previously this test caused the embedded nvim to panic.
* lua: Add ability to pass tables with __callTJ DeVries2020-07-10
| | | | | | | | | | | | vim-patch:8.2.1054: not so easy to pass a lua function to Vim vim-patch:8.2.1084: Lua: registering function has useless code I think I have also opened up the possibility for people to use these callbacks elsewhere, since I've added a new struct that we should be able to use. Also, this should allow us to determine what the state of a list is in Lua or a dictionary in Lua, since we now can track the luaref as we go.
* lua: Add ability to pass lua functions directly to vimLTJ DeVries2020-07-10
|
* Add v:lua.func() vimL syntax for calling luaBjörn Linse2019-11-16
| | | | Also simplify error messages when calling lua from vimL.
* API: return non-generic VimL errorsJustin M. Keyes2018-05-09
| | | | | | | | | | - Return VimL errors instead of generic errors for: - nvim_call_function - nvim_call_dict_function - Fix tests which were silently broken before this change. This violates #6150 where we agreed not to translate API errors. But that can be fixed later.
* executor,functests: Add print() tests, some fixesZyX2017-03-27
|
* executor: Fix some memory leaksZyX2017-03-27
|
* executor: Add :luado commandZyX2017-03-27
|
* doc,functests: Add documentationZyX2017-03-27
| | | Missing: updates to various lists.
* functests: Some more testsZyX2017-03-27
|
* functests: Move existing tests from lua_spec to lua/*, fix themZyX2017-03-27
|
* functests: Add some testsZyX2017-03-27