mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
refactor(lua): use Arena when converting from lua stack to API args
and for return value of nlua_exec/nlua_call_ref, as this uses the same family of functions. NB: the handling of luaref:s is a bit of a mess. add api_luarefs_free_XX functions as a stop-gap as refactoring luarefs is a can of worms for another PR:s. as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves arbitrary return values.
This commit is contained in:
@@ -2681,9 +2681,9 @@ void list_in_columns(char **items, int size, int current)
|
||||
|
||||
void list_lua_version(void)
|
||||
{
|
||||
char *code = "return ((jit and jit.version) and jit.version or _VERSION)";
|
||||
Error err = ERROR_INIT;
|
||||
Object ret = nlua_exec(cstr_as_string(code), (Array)ARRAY_DICT_INIT, &err);
|
||||
Object ret = NLUA_EXEC_STATIC("return ((jit and jit.version) and jit.version or _VERSION)",
|
||||
(Array)ARRAY_DICT_INIT, kRetObject, NULL, &err);
|
||||
assert(!ERROR_SET(&err));
|
||||
assert(ret.type == kObjectTypeString);
|
||||
msg(ret.data.string.data, 0);
|
||||
|
Reference in New Issue
Block a user