From 1a655b71a888a2be86ff7d1ff534eac32fc83620 Mon Sep 17 00:00:00 2001 From: JP <17429390+resolritter@users.noreply.github.com> Date: Mon, 18 Jul 2022 22:11:13 -0300 Subject: fix(lua): make it possible to cancel vim.wait() with Ctrl-C (#19217) --- src/nvim/lua/executor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index ad03ebd1ed..fcbf36c711 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -416,9 +416,9 @@ static int nlua_wait(lua_State *lstate) LOOP_PROCESS_EVENTS_UNTIL(&main_loop, loop_events, (int)timeout, - is_function ? nlua_wait_condition(lstate, - &pcall_status, - &callback_result) : false || got_int); + got_int || (is_function ? nlua_wait_condition(lstate, + &pcall_status, + &callback_result) : false)); // Stop dummy timer time_watcher_stop(tw); -- cgit From a7b9920930f032419439f52ca529abcffc0d15b1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 22 Jul 2022 22:05:02 +0800 Subject: refactor: move FunPtr to types.h (#19466) This type itself is not eval-specific. Moving it to types.h can avoid including eval/funcs.h in many headers, and types.h is already included by many headers. --- src/nvim/lua/executor.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index fcbf36c711..824b9a8ec0 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -15,6 +15,7 @@ #include "nvim/buffer_defs.h" #include "nvim/change.h" #include "nvim/cursor.h" +#include "nvim/eval/funcs.h" #include "nvim/eval/typval.h" #include "nvim/eval/userfunc.h" #include "nvim/event/loop.h" -- cgit From 824a729628950d72834b98faf28d18b7a94eefb2 Mon Sep 17 00:00:00 2001 From: Dundar Goc Date: Tue, 19 Jul 2022 15:30:57 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/lua/executor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 824b9a8ec0..b18770d4f1 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1674,7 +1674,7 @@ static void nlua_add_treesitter(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL lua_setfield(lstate, -2, "_ts_get_minimum_language_version"); } -int nlua_expand_pat(expand_T *xp, char_u *pat, int *num_results, char_u ***results) +int nlua_expand_pat(expand_T *xp, char_u *pat, int *num_results, char ***results) { lua_State *const lstate = global_lstate; int ret = OK; -- cgit From abc087f4c65ca547cae58518b42aee82ff4a07f6 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 31 Jul 2022 10:46:38 +0200 Subject: docs: fix typos (#19024) Co-authored-by: zeertzjq Co-authored-by: Valery Viktorovsky --- src/nvim/lua/executor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 824b9a8ec0..81314f8b4a 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1686,7 +1686,7 @@ int nlua_expand_pat(expand_T *xp, char_u *pat, int *num_results, char_u ***resul lua_getfield(lstate, -1, "_expand_pat"); luaL_checktype(lstate, -1, LUA_TFUNCTION); - // [ vim, vim._on_key, buf ] + // [ vim, vim._expand_pat, buf ] lua_pushlstring(lstate, (const char *)pat, STRLEN(pat)); if (nlua_pcall(lstate, 1, 2) != 0) { @@ -1839,7 +1839,7 @@ void nlua_execute_on_key(int c) // [ vim ] lua_getglobal(lstate, "vim"); - // [ vim, vim._on_key] + // [ vim, vim._on_key ] lua_getfield(lstate, -1, "_on_key"); luaL_checktype(lstate, -1, LUA_TFUNCTION); -- cgit