diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-15 15:44:41 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-04-15 15:44:41 +0000 |
commit | 66aa4e5feff68d520ab3c39a1a314b09ba5541a1 (patch) | |
tree | 4bb98fd70e10819ec0ecc6f01313070992b875af /usr.bin/tmux | |
parent | 9db054cdd75a9303eb4f3e64e4da50dee359242a (diff) |
Fix setting old-style window -fg/-bg/-attr options that aren't global.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/style.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tmux/style.c b/usr.bin/tmux/style.c index ff480674eaf..b30b95bfd30 100644 --- a/usr.bin/tmux/style.c +++ b/usr.bin/tmux/style.c @@ -1,4 +1,4 @@ -/* $OpenBSD: style.c,v 1.5 2015/02/18 15:32:37 nicm Exp $ */ +/* $OpenBSD: style.c,v 1.6 2015/04/15 15:44:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |