From 243fb87c27ffb4f8301fb63d7f0b7d17e61f83df Mon Sep 17 00:00:00 2001 From: sewn Date: Thu, 1 Feb 2024 18:43:30 +0300 Subject: allow disabling of statusbar --- vis-lua.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index 7c5da2a..98a5249 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -1960,6 +1960,12 @@ static int window_options_assign(Win *win, lua_State *L, const char *key, int ne else flags &= ~UI_OPTION_SYMBOL_TAB; view_options_set(win->view, flags); + } else if (strcmp(key, "statusbar") == 0) { + if (lua_toboolean(L, next)) + flags |= UI_OPTION_STATUSBAR; + else + flags &= ~UI_OPTION_STATUSBAR; + view_options_set(win->view, flags); } else if (strcmp(key, "wrapcolumn") == 0 || strcmp(key, "wc") == 0) { view_wrapcolumn_set(win->view, luaL_checkint(L, next)); } else if (strcmp(key, "tabwidth") == 0 || strcmp(key, "tw") == 0) { @@ -2175,6 +2181,7 @@ static const struct luaL_Reg window_funcs[] = { * @tfield[opt=false] boolean shownewlines * @tfield[opt=false] boolean showspaces * @tfield[opt=false] boolean showtabs + * @tfield[opt=true] boolean statusbar * @tfield[opt=8] int tabwidth {tw} * @tfield[opt=0] int wrapcolumn {wc} * @see Vis.options @@ -2216,6 +2223,9 @@ static int window_options_index(lua_State *L) { } else if (strcmp(key, "showtabs") == 0) { lua_pushboolean(L, view_options_get(win->view) & UI_OPTION_SYMBOL_TAB); return 1; + } else if (strcmp(key, "statusbar") == 0) { + lua_pushboolean(L, view_options_get(win->view) & UI_OPTION_STATUSBAR); + return 1; } else if (strcmp(key, "tabwidth") == 0 || strcmp(key, "tw") == 0) { lua_pushinteger(L, view_tabwidth_get(win->view)); return 1; -- cgit v1.2.3