lua: add vim.register_keystroke_callback (#12536)

* feat: Add vim.register_keystroke_callback

* fixup: Forgot to remove mention of old option

* fixup: Answer jamessan comments

* fixup: Answer norcalli comments

* fixup: portability

* Update runtime/doc/lua.txt

Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
This commit is contained in:
TJ DeVries
2020-08-14 10:03:17 -04:00
committed by GitHub
parent aa48c1c724
commit 3ccdbc570d
6 changed files with 235 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/func_attr.h"
#include "nvim/lua/executor.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
@@ -1535,6 +1536,9 @@ int vgetc(void)
*/
may_garbage_collect = false;
// Exec lua callbacks for on_keystroke
nlua_execute_log_keystroke(c);
return c;
}