aboutsummaryrefslogtreecommitdiff
path: root/style.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-09-14 14:01:09 +0100
committerThomas Adam <thomas@xteddy.org>2015-09-14 14:01:09 +0100
commit4afe26fa82fd2701cbf686799668d685645b220e (patch)
treeebb25aa2f8485b643136b210ee0df521c5cbe4c8 /style.c
parent74b958ecbed7102a0f3f5faf5d976411726661ba (diff)
parent216ddf3da5798fe3e7246310ebe0b77e591ee34e (diff)
downloadrtmux-4afe26fa82fd2701cbf686799668d685645b220e.tar.gz
rtmux-4afe26fa82fd2701cbf686799668d685645b220e.tar.bz2
rtmux-4afe26fa82fd2701cbf686799668d685645b220e.zip
Merge branch 'obsd-master'
Diffstat (limited to 'style.c')
-rw-r--r--style.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/style.c b/style.c
index 9fafdd1d..c00b0fee 100644
--- a/style.c
+++ b/style.c
@@ -252,3 +252,15 @@ style_apply_update(struct grid_cell *gc, struct options *oo, const char *name)
if (gcp->attr != 0)
gc->attr |= gcp->attr;
}
+
+/* Check if two styles are the same. */
+int
+style_equal(const struct grid_cell *gc1, const struct grid_cell *gc2)
+{
+ return gc1->fg == gc2->fg &&
+ gc1->bg == gc2->bg &&
+ (gc1->flags & ~GRID_FLAG_PADDING) ==
+ (gc2->flags & ~GRID_FLAG_PADDING) &&
+ (gc1->attr & ~GRID_ATTR_CHARSET) ==
+ (gc2->attr & ~GRID_ATTR_CHARSET);
+}