Files
neovim/src/nvim/lua/converter.h
TJ DeVries 6360cf7ce8 lua: Add ability to pass tables with __call
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.
2020-07-10 20:23:12 -04:00

25 lines
461 B
C

#ifndef NVIM_LUA_CONVERTER_H
#define NVIM_LUA_CONVERTER_H
#include <lua.h>
#include <stdbool.h>
#include <stdint.h>
#include "nvim/api/private/defs.h"
#include "nvim/func_attr.h"
#include "nvim/eval.h"
typedef struct {
LuaRef func_ref;
LuaRef table_ref;
} LuaCallable;
typedef struct {
LuaCallable lua_callable;
} LuaCFunctionState;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "lua/converter.h.generated.h"
#endif
#endif // NVIM_LUA_CONVERTER_H