aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index a62daf8..ca36d2d 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2019,6 +2019,12 @@ static int window_newindex(lua_State *L) {
}
lua_pop(L, 1);
return ret;
+ } else if (strcmp(key, "file") == 0 && lua_isstring(L, 3)) {
+ const char* filename = lua_tostring(L, 3);
+ if (!vis_window_change_file(win, filename)) {
+ return luaL_argerror(L, 3, "failed to open");
+ }
+ return 0;
}
}