diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-01 11:56:47 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-01 12:38:40 +0200 |
| commit | ffc9062fe803b71510b1d4f6ba8d4bfa24e798fa (patch) | |
| tree | 98175e7b5bbde3e8874d96bd9b2a57d7fb89f70a /vis-lua.c | |
| parent | eb7279f5b0a0fcfec92857b042f498f935e39af9 (diff) | |
| download | vis-ffc9062fe803b71510b1d4f6ba8d4bfa24e798fa.tar.gz vis-ffc9062fe803b71510b1d4f6ba8d4bfa24e798fa.tar.xz | |
vis-lua: expose vis:feedkeys API
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 }, |
