mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 12:58:16 +00:00
fix(lua): clear got_int when calling vim.on_key() callback (#18979)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user