vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit ca63a275923cb7a8a78b66d20b7a7a06d6b6cc37 parent 5bf9a7a28d1e0be2ee0c0ae654e1d9f516d8f728 Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 16 May 2018 18:35:06 +0200 vis-lua: expose current input_queue content Diffstat:
| M | vis-lua.c | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git 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;