summaryrefslogtreecommitdiffstats
path: root/style.c
diff options
context:
space:
mode:
authornicm <nicm>2015-04-15 15:44:40 +0000
committernicm <nicm>2015-04-15 15:44:40 +0000
commitf922920609063ff5ac1ee11a48bf8f1bd13e8d16 (patch)
treea5cc5fd21efadddd2995747f571b4a14d71219cd /style.c
parent0cd55eb1e7823a75810b7f43f53b6266cb8b0bc0 (diff)
Fix setting old-style window -fg/-bg/-attr options that aren't global.
Diffstat (limited to 'style.c')
-rw-r--r--style.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/style.c b/style.c
index d8ab07a3..5534f118 100644
--- a/style.c
+++ b/style.c
@@ -160,13 +160,21 @@ style_update_new(struct options *oo, const char *name, const char *newname)
{
int value;
struct grid_cell *gc;
+ struct options_entry *o;
/* It's a colour or attribute, but with no -style equivalent. */
if (newname == NULL)
return;
- gc = options_get_style(oo, newname);
- value = options_get_number(oo, name);
+ o = options_find1(oo, newname);
+ if (o == NULL)
+ o = options_set_style (oo, newname, "default", 0);
+ gc = &o->style;
+
+ o = options_find1(oo, name);
+ if (o == NULL)
+ o = options_set_number (oo, name, 8);
+ value = o->num;
if (strstr(name, "-bg") != NULL)
colour_set_bg(gc, value);