aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorsewn <sewn@disroot.org>2024-02-01 18:43:30 +0300
committersewn <sewn@disroot.org>2024-02-01 18:43:30 +0300
commit243fb87c27ffb4f8301fb63d7f0b7d17e61f83df (patch)
tree9954b90a6afe3cdd4633a42831672c8c2e38ae8b /vis-lua.c
parent5cd6d033405d3e659ece371f1136445197d43ba7 (diff)
downloadvis-243fb87c27ffb4f8301fb63d7f0b7d17e61f83df.tar.gz
vis-243fb87c27ffb4f8301fb63d7f0b7d17e61f83df.tar.xz
allow disabling of statusbar
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c10
1 files changed, 10 insertions, 0 deletions
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;