From bff2afbf1dc4b302f600e56d46cb413f1c31be3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 21 May 2016 22:25:58 +0200 Subject: vis-lua: add vis.recording property --- README.md | 1 + vis-lua.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 6a77f22..443ba82 100644 --- a/README.md +++ b/README.md @@ -601,6 +601,7 @@ At this time there exists no API stability guarantees. - `command_register(name, function(argv, force, win, cursor, range))` hook up a Lua function to `:name` command - `map(mode, key, function)` map a Lua function to `key` in `mode` - `feedkeys(keys)` interpret `keys` as if they were read from the keyboard. If called from a key handling function, the keys will only be processed *after* the current key handling function has returned. + - `recording` boolean property, indicates whether a macro is currently being recorded - `file` - `content(pos, len)` or `content({start, finish})` - `insert(pos, data)` diff --git a/vis-lua.c b/vis-lua.c index b65796e..f1cc453 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -556,6 +556,10 @@ static int vis_index(lua_State *L) { return 1; } + if (strcmp(key, "recording") == 0) { + lua_pushboolean(L, vis_macro_recording(vis)); + return 1; + } } return index_common(L); -- cgit v1.2.3