Data Structures | Macros | Functions
executor.c File Reference
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include "nvim/misc1.h"
#include "nvim/getchar.h"
#include "nvim/garray.h"
#include "nvim/func_attr.h"
#include "nvim/api/private/defs.h"
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/vim.h"
#include "nvim/ex_getln.h"
#include "nvim/ex_cmds2.h"
#include "nvim/message.h"
#include "nvim/memline.h"
#include "nvim/buffer_defs.h"
#include "nvim/macros.h"
#include "nvim/screen.h"
#include "nvim/cursor.h"
#include "nvim/undo.h"
#include "nvim/ascii.h"
#include "nvim/lua/executor.h"
#include "nvim/lua/converter.h"
#include "luv/luv.h"

Data Structures

struct  LuaError
 

Macros

#define NLUA_EVAL_NAME   "<VimL compiled string>"
 Name of the run code for use in messages. More...
 
#define PRINT_ERROR(msg)
 
#define EVALHEADER   "local _A=select(1,...) return ("
 
#define DOSTART   "return function(line, linenr) "
 
#define DOEND   " end"
 

Functions

void executor_exec_lua (const String str, typval_T *const ret_tv) FUNC_ATTR_NONNULL_ALL
 
int nlua_debug (lua_State *lstate) FUNC_ATTR_NONNULL_ALL
 
LuaRef nlua_ref (lua_State *lstate, int index)
 add the value to the registry More...
 
void nlua_unref (lua_State *lstate, LuaRef ref)
 remove the value from the registry More...
 
void executor_free_luaref (LuaRef ref)
 
void nlua_pushref (lua_State *lstate, LuaRef ref)
 push a value referenced in the regirstry More...
 
void executor_eval_lua (const String str, typval_T *const arg, typval_T *const ret_tv) FUNC_ATTR_NONNULL_ALL
 
Object executor_exec_lua_api (const String str, const Array args, Error *err)
 
Object executor_exec_lua_cb (LuaRef ref, const char *name, Array args, bool retval)
 
void ex_lua (exarg_T *const eap) FUNC_ATTR_NONNULL_ALL
 
void ex_luado (exarg_T *const eap) FUNC_ATTR_NONNULL_ALL
 
void ex_luafile (exarg_T *const eap) FUNC_ATTR_NONNULL_ALL
 

Macro Definition Documentation

#define DOEND   " end"
#define DOSTART   "return function(line, linenr) "
#define EVALHEADER   "local _A=select(1,...) return ("
#define NLUA_EVAL_NAME   "<VimL compiled string>"

Name of the run code for use in messages.

#define PRINT_ERROR (   msg)
Value:
do { \
errmsg = msg; \
errmsg_len = sizeof(msg) - 1; \
goto nlua_print_error; \
} while (0)
err msg
Definition: helpers.c:1417

Function Documentation

void ex_lua ( exarg_T *const  eap)

Run lua string

Used for :lua.

Parameters
eapVimL command being run.
void ex_luado ( exarg_T *const  eap)

Run lua string for each line in range

Used for :luado.

Parameters
eapVimL command being run.
void ex_luafile ( exarg_T *const  eap)

Run lua file

Used for :luafile.

Parameters
eapVimL command being run.
void executor_eval_lua ( const String  str,
typval_T *const  arg,
typval_T *const  ret_tv 
)

Evaluate lua string

Used for luaeval().

Parameters
[in]strString to execute.
[in]argSecond argument to luaeval().
[out]ret_tvLocation where result will be saved.
Returns
Result of the execution.
void executor_exec_lua ( const String  str,
typval_T *const  ret_tv 
)

Execute lua string

Parameters
[in]strString to execute.
[out]ret_tvLocation where result will be saved.
Returns
Result of the execution.
Object executor_exec_lua_api ( const String  str,
const Array  args,
Error err 
)

Execute lua string

Used for nvim_execute_lua().

Parameters
[in]strString to execute.
[in]argsarray of ... args
[out]errLocation where error will be saved.
Returns
Return value of the execution.
Object executor_exec_lua_cb ( LuaRef  ref,
const char *  name,
Array  args,
bool  retval 
)
void executor_free_luaref ( LuaRef  ref)
int nlua_debug ( lua_State *  lstate)

debug.debug: interaction with user while debugging.

Parameters
lstateLua interpreter state.
void nlua_pushref ( lua_State *  lstate,
LuaRef  ref 
)

push a value referenced in the regirstry

LuaRef nlua_ref ( lua_State *  lstate,
int  index 
)

add the value to the registry

void nlua_unref ( lua_State *  lstate,
LuaRef  ref 
)

remove the value from the registry