summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-05-08 05:53:29 +0000
committernicm <nicm@openbsd.org>2014-05-08 05:53:29 +0000
commitc286cc6911457f2b8f333f1b882a4bbda30e9070 (patch)
tree0f0d0ceb9a71c1d36e5148e7a722bd9161bb3932 /usr.bin
parentGet __STRICT_ALIGNMENT from <machine/endian.h> and decide upon it, rather (diff)
downloadwireguard-openbsd-c286cc6911457f2b8f333f1b882a4bbda30e9070.tar.xz
wireguard-openbsd-c286cc6911457f2b8f333f1b882a4bbda30e9070.zip
Handle colour 8 properly in the 256 colour palette, from Timothy Allen.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/style.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/style.c b/usr.bin/tmux/style.c
index 2529ee0ce9a..3f42c4b4962 100644
--- a/usr.bin/tmux/style.c
+++ b/usr.bin/tmux/style.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: style.c,v 1.2 2014/02/22 01:38:47 nicm Exp $ */
+/* $OpenBSD: style.c,v 1.3 2014/05/08 05:53:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -117,7 +117,7 @@ style_tostring(struct grid_cell *gc)
*s = '\0';
- if (gc->fg != 8) {
+ if (gc->fg != 8 || gc->flags & GRID_FLAG_FG256) {
if (gc->flags & GRID_FLAG_FG256)
c = gc->fg | 0x100;
else
@@ -126,7 +126,7 @@ style_tostring(struct grid_cell *gc)
comma = 1;
}
- if (gc->bg != 8) {
+ if (gc->bg != 8 || gc->flags & GRID_FLAG_BG256) {
if (gc->flags & GRID_FLAG_BG256)
c = gc->bg | 0x100;
else
@@ -221,13 +221,13 @@ style_apply_update(struct grid_cell *gc, struct options *oo, const char *name)
struct grid_cell *gcp;
gcp = options_get_style(oo, name);
- if (gcp->fg != 8) {
+ if (gcp->fg != 8 || gcp->flags & GRID_FLAG_FG256) {
if (gcp->flags & GRID_FLAG_FG256)
colour_set_fg(gc, gcp->fg | 0x100);
else
colour_set_fg(gc, gcp->fg);
}
- if (gcp->bg != 8) {
+ if (gcp->bg != 8 || gcp->flags & GRID_FLAG_BG256) {
if (gcp->flags & GRID_FLAG_BG256)
colour_set_bg(gc, gcp->bg | 0x100);
else