aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-02-17 14:42:13 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-02-18 16:50:39 +0100
commit5d9cf02bc9993e076c883f67e3c19bde745540ae (patch)
tree7bccb6f29f57054f62d776042db606ab33dc9fbe /vis-lua.c
parent505fc2aac6144291e4a43873282456979db4bb62 (diff)
downloadvis-5d9cf02bc9993e076c883f67e3c19bde745540ae.tar.gz
vis-5d9cf02bc9993e076c883f67e3c19bde745540ae.tar.xz
vis-lua: expose mode constants to lua
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index b6b4668..2b79bf1 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -379,6 +379,36 @@ static int vis_index(lua_State *L) {
obj_ref_new(L, vis->windows, "vis.window");
return 1;
}
+
+ if (strcmp(key, "MODE_NORMAL") == 0) {
+ lua_pushunsigned(L, VIS_MODE_NORMAL);
+ return 1;
+ }
+
+ if (strcmp(key, "MODE_OPERATOR_PENDING") == 0) {
+ lua_pushunsigned(L, VIS_MODE_OPERATOR_PENDING);
+ return 1;
+ }
+
+ if (strcmp(key, "MODE_VISUAL") == 0) {
+ lua_pushunsigned(L, VIS_MODE_VISUAL);
+ return 1;
+ }
+
+ if (strcmp(key, "MODE_VISUAL_LINE") == 0) {
+ lua_pushunsigned(L, VIS_MODE_VISUAL_LINE);
+ return 1;
+ }
+
+ if (strcmp(key, "MODE_INSERT") == 0) {
+ lua_pushunsigned(L, VIS_MODE_INSERT);
+ return 1;
+ }
+
+ if (strcmp(key, "MODE_REPLACE") == 0) {
+ lua_pushunsigned(L, VIS_MODE_REPLACE);
+ return 1;
+ }
}
return index_common(L);