aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-12 15:56:43 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-03-12 15:56:43 +0100
commitccf51dade645a70bb8c0309ee9caa2eab4b77f00 (patch)
treef57f2e1245ae37fd88527b3a2cf0703a7bdfff4b /view.c
parente22ab83c14a92f32e4479f527f82d67e5959e27a (diff)
downloadvis-ccf51dade645a70bb8c0309ee9caa2eab4b77f00.tar.gz
vis-ccf51dade645a70bb8c0309ee9caa2eab4b77f00.tar.xz
view: also load lua theme for windows without syntax highlighting
This for example affects the default background color and cursor related settings.
Diffstat (limited to 'view.c')
-rw-r--r--view.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/view.c b/view.c
index 4b2f7c8..e170b22 100644
--- a/view.c
+++ b/view.c
@@ -209,15 +209,9 @@ static void view_syntax_color(View *view) {
}
bool view_syntax_set(View *view, const char *name) {
- if (!name) {
- free(view->lexer_name);
- view->lexer_name = NULL;
- return true;
- }
-
lua_State *L = view->lua;
if (!L)
- return false;
+ return name == NULL;
/* Try to load the specified lexer and parse its token styles.
* Roughly equivalent to the following lua code:
@@ -251,6 +245,12 @@ bool view_syntax_set(View *view, const char *name) {
view->ui->syntax_style(view->ui, UI_STYLE_COLOR_COLUMN, lua_tostring(L, -1));
lua_pop(L, 1);
+ if (!name) {
+ free(view->lexer_name);
+ view->lexer_name = NULL;
+ return true;
+ }
+
lua_getfield(L, -1, "load");
lua_pushstring(L, name);