diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | vis-lua.c | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -570,6 +570,7 @@ At this time there exists no API stability guarantees. - `vis` - `MODE_NORMAL`, `MODE_OPERATOR_PENDING`, `MODE_INSERT`, `MODE_REPLACE`, `MODE_VISUAL`, `MODE_VISUAL_LINE` mode constants + - `mode` current mode (one of the above constants) - `lexers` LPeg lexer support module - `events` hooks - `start()` @@ -444,6 +444,11 @@ static int vis_index(lua_State *L) { return 1; } + if (strcmp(key, "mode") == 0) { + lua_pushunsigned(L, vis->mode->id); + return 1; + } + if (strcmp(key, "MODE_NORMAL") == 0) { lua_pushunsigned(L, VIS_MODE_NORMAL); return 1; |
