aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--vis-lua.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index c7b7d5f..bf06725 100644
--- a/README.md
+++ b/README.md
@@ -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()`
diff --git a/vis-lua.c b/vis-lua.c
index 4b484b2..4b6c2d4 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -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;