vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 1f258cac555ca773438e76be01439196c6fb5d9b
parent ec383ff3050806ff1aa83fcecc3973e4f59474b7
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sat, 12 Mar 2016 15:58:15 +0100

vis-lua: allow to set window.syntax = nil

This will load the default lua color theme.

Diffstat:
Mvis-lua.c | 4+++-
Mvisrc.lua | 3+++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 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; } diff --git a/visrc.lua b/visrc.lua @@ -196,4 +196,7 @@ vis.events.win_open = function(win) end end end + + win.syntax = nil + end