From ffc9062fe803b71510b1d4f6ba8d4bfa24e798fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 1 May 2016 11:56:47 +0200 Subject: vis-lua: expose vis:feedkeys API --- vis-lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index d9598bb..9df2a8e 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -510,6 +510,15 @@ static int command_register(lua_State *L) { return 1; } +static int feedkeys(lua_State *L) { + Vis *vis = obj_ref_check(L, 1, "vis"); + const char *keys = luaL_checkstring(L, 2); + if (vis) + vis_keys_feed(vis, keys); + lua_pushboolean(L, vis != NULL); + return 1; +} + static int vis_index(lua_State *L) { Vis *vis = obj_ref_check(L, 1, "vis"); if (!vis) { @@ -583,6 +592,7 @@ static const struct luaL_Reg vis_lua[] = { { "textobject", textobject }, { "textobject_register", textobject_register }, { "command_register", command_register }, + { "feedkeys", feedkeys }, { "__index", vis_index }, { "__newindex", vis_newindex }, { NULL, NULL }, -- cgit v1.2.3