aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-12-21 15:57:55 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-12-23 14:00:09 +0100
commiteae6727325111e596b49bb04337a467e8833397c (patch)
tree7be92bb7cb7cf1575ca0c714b8c7012fd25d6555 /src/nvim/lua/executor.c
parent7121241e5cecbd741795aec37a3cb1203c8e9f34 (diff)
downloadrneovim-eae6727325111e596b49bb04337a467e8833397c.tar.gz
rneovim-eae6727325111e596b49bb04337a467e8833397c.tar.bz2
rneovim-eae6727325111e596b49bb04337a467e8833397c.zip
refactor: remove os_errmsg and os_msg functions
Instead replace them with fprintf and printf.
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 3e7cdd002e..6289ea3193 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -252,8 +252,7 @@ static int nlua_luv_thread_common_cfpcall(lua_State *lstate, int nargs, int nres
if (status == LUA_ERRMEM && !(flags & LUVF_CALLBACK_NOEXIT)) {
// Terminate this thread, as the main thread may be able to continue
// execution.
- os_errmsg(e_outofmem);
- os_errmsg("\n");
+ fprintf(stderr, "%s\n", e_outofmem);
lua_close(lstate);
#ifdef MSWIN
ExitThread(0);
@@ -640,8 +639,7 @@ static bool nlua_init_packages(lua_State *lstate, bool is_standalone)
lua_getglobal(lstate, "require");
lua_pushstring(lstate, "vim._init_packages");
if (nlua_pcall(lstate, 1, 0)) {
- os_errmsg(lua_tostring(lstate, -1));
- os_errmsg("\n");
+ fprintf(stderr, "%s\n", lua_tostring(lstate, -1));
return false;
}
@@ -815,12 +813,12 @@ void nlua_init(char **argv, int argc, int lua_arg0)
lua_State *lstate = luaL_newstate();
if (lstate == NULL) {
- os_errmsg(_("E970: Failed to initialize lua interpreter\n"));
+ fprintf(stderr, _("E970: Failed to initialize lua interpreter\n"));
os_exit(1);
}
luaL_openlibs(lstate);
if (!nlua_state_init(lstate)) {
- os_errmsg(_("E970: Failed to initialize builtin lua modules\n"));
+ fprintf(stderr, _("E970: Failed to initialize builtin lua modules\n"));
#ifdef EXITFREE
nlua_common_free_all_mem(lstate);
#endif
@@ -2307,8 +2305,7 @@ void nlua_init_defaults(void)
lua_getglobal(L, "require");
lua_pushstring(L, "vim._defaults");
if (nlua_pcall(L, 1, 0)) {
- os_errmsg(lua_tostring(L, -1));
- os_errmsg("\n");
+ fprintf(stderr, "%s\n", lua_tostring(L, -1));
}
}