aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 527202d..35dbe95 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -537,7 +537,9 @@ static int window_newindex(lua_State *L) {
if (lua_isstring(L, 2)) {
const char *key = lua_tostring(L, 2);
if (strcmp(key, "syntax") == 0) {
- const char *syntax = luaL_checkstring(L, 3);
+ const char *syntax = NULL;
+ if (!lua_isnil(L, 3))
+ syntax = luaL_checkstring(L, 3);
view_syntax_set(win->view, syntax);
return 0;
}