diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-01-02 15:34:14 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2023-01-05 17:10:02 +0100 |
commit | adef308a5925a3b967af3bd7c598074e5b6cae18 (patch) | |
tree | 10bb0dc4b3801eb53b56023542283c20aff7e967 /src/nvim/lua/executor.c | |
parent | 45549f031ee52a01601c33acc411f3111cfc4e95 (diff) | |
download | rneovim-adef308a5925a3b967af3bd7c598074e5b6cae18.tar.gz rneovim-adef308a5925a3b967af3bd7c598074e5b6cae18.tar.bz2 rneovim-adef308a5925a3b967af3bd7c598074e5b6cae18.zip |
feat(lua): exit 1 on Lua "-l" script error
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 20c901004a..4b08603dd0 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -325,10 +325,11 @@ static int nlua_thr_api_nvim__get_runtime(lua_State *lstate) /// Copies args starting at `lua_arg0` into the Lua `arg` global. /// -/// Example: +/// Example (`lua_arg0` points to "--arg1"): /// nvim -l foo.lua --arg1 --arg2 /// -/// @note `lua` CLI sets _negative_ `arg` indices to the arguments upto "-e". +/// @note Lua CLI sets arguments upto "-e" as _negative_ `_G.arg` indices, but we currently don't +/// follow that convention. /// /// @see https://www.lua.org/pil/1.4.html /// @see https://github.com/premake/premake-core/blob/1c1304637f4f5e50ba8c57aae8d1d80ec3b7aaf2/src/host/premake.c#L563-L594 @@ -1710,10 +1711,10 @@ void ex_luafile(exarg_T *const eap) nlua_exec_file((const char *)eap->arg); } -/// execute lua code from a file. +/// Executes Lua code from a file. /// -/// Note: we call the lua global loadfile as opposed to calling luaL_loadfile -/// in case loadfile has been overridden in the users environment. +/// Note: we call the Lua global loadfile as opposed to calling luaL_loadfile +/// in case loadfile was overridden in the user's environment. /// /// @param path path of the file /// |