mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00

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.
25 lines
461 B
C
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
|