diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-22 23:25:34 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-22 23:25:34 +0100 |
| commit | bfd007ca946c06d1d5743a0dcf97d454d27ec6e3 (patch) | |
| tree | fdff6e566159b4abe349beea45920d6defb78dbf | |
| parent | 0cbd1b87ed4908a3675c6604a0e1780c5ef265a1 (diff) | |
| download | vis-bfd007ca946c06d1d5743a0dcf97d454d27ec6e3.tar.gz vis-bfd007ca946c06d1d5743a0dcf97d454d27ec6e3.tar.xz | |
vis-lua: expose current count specifier as vis:count
| -rw-r--r-- | vis-lua.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -563,6 +563,10 @@ static const char *keymapping(Vis *vis, const char *keys, const Arg *arg) { * LPeg lexer module. * @field lpeg might be `nil` if module is not found */ +/*** + * Current count. + * @tfield int count the specified count for the current command or `nil` if none was given + */ /*** * Create an iterator over all windows. @@ -1111,6 +1115,15 @@ static int vis_index(lua_State *L) { return 1; } + if (strcmp(key, "count") == 0) { + int count = vis_count_get(vis); + if (count == VIS_COUNT_UNKNOWN) + lua_pushnil(L); + else + lua_pushunsigned(L, count); + return 1; + } + if (strcmp(key, "registers") == 0) { obj_ref_new(L, vis->ui, "vis.registers"); return 1; |
