aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-16 18:51:36 +0800
committerGitHub <noreply@github.com>2022-06-16 18:51:36 +0800
commit179faa3edd6120a483b55aadf0a367fbf07b25fd (patch)
tree84ba1945cae3d370bfde437179ece858a11cb017 /src/nvim/lua/executor.c
parent0e8186bdd8699fb20ad70e28813c3603f9ff0ece (diff)
downloadrneovim-179faa3edd6120a483b55aadf0a367fbf07b25fd.tar.gz
rneovim-179faa3edd6120a483b55aadf0a367fbf07b25fd.tar.bz2
rneovim-179faa3edd6120a483b55aadf0a367fbf07b25fd.zip
fix(lua): clear got_int when calling vim.on_key() callback (#18979)
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 30ae274607..164542f4ab 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1775,10 +1775,13 @@ void nlua_execute_on_key(int c)
// [ vim, vim._on_key, buf ]
lua_pushlstring(lstate, (const char *)buf, buf_len);
+ int save_got_int = got_int;
+ got_int = false; // avoid interrupts when the key typed is Ctrl-C
if (nlua_pcall(lstate, 1, 0)) {
nlua_error(lstate,
_("Error executing vim.on_key Lua callback: %.*s"));
}
+ got_int |= save_got_int;
// [ vim ]
lua_pop(lstate, 1);