aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-05-16 18:35:06 +0200
committerMarc André Tanner <mat@brain-dump.org>2018-05-17 21:51:33 +0200
commit50b49e661aea8d7b9873a9e84a51f72b3121ad52 (patch)
treef2af5c468c43324dfb3fab805cc11a171f7c38f9
parentf4832217ce7c6082a90418aed6db5dc201553521 (diff)
downloadvis-50b49e661aea8d7b9873a9e84a51f72b3121ad52.tar.gz
vis-50b49e661aea8d7b9873a9e84a51f72b3121ad52.tar.xz
vis-lua: expose current input_queue content
-rw-r--r--vis-lua.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 70c3996..0031421 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -1368,6 +1368,10 @@ static int pipe_func(lua_State *L) {
* Whether a macro is being recorded.
* @tfield bool recording
*/
+/***
+ * Currently unconsumed keys in the input queue.
+ * @tfield string input_queue
+ */
static int vis_index(lua_State *L) {
Vis *vis = obj_ref_check(L, 1, "vis");
@@ -1386,6 +1390,11 @@ static int vis_index(lua_State *L) {
return 1;
}
+ if (strcmp(key, "input_queue") == 0) {
+ lua_pushstring(L, buffer_content0(&vis->input_queue));
+ return 1;
+ }
+
if (strcmp(key, "recording") == 0) {
lua_pushboolean(L, vis_macro_recording(vis));
return 1;