summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-05-23 19:19:41 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-05-23 19:19:41 +0000
commit6512e92d37b1b4f867171e80f8d8574b6f22912a (patch)
tree939ce3220ba00fe21ddc8fcf9e3bb43d042f05b5
parentebcb7726ac2319dfe59a19fa006593db5f892fea (diff)
Use a predefined structure for not-space cells used to set attributes.
-rw-r--r--usr.bin/tmux/grid.c3
-rw-r--r--usr.bin/tmux/screen-redraw.c13
-rw-r--r--usr.bin/tmux/tmux.h3
3 files changed, 9 insertions, 10 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c
index b2c5538507c..3c4cbe18c1a 100644
--- a/usr.bin/tmux/grid.c
+++ b/usr.bin/tmux/grid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid.c,v 1.18 2010/04/06 21:35:44 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.19 2012/05/23 19:19:40 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -36,6 +36,7 @@
/* Default grid cell data. */
const struct grid_cell grid_default_cell = { 0, 0, 8, 8, ' ' };
+const struct grid_cell grid_marker_cell = { 0, 0, 8, 8, '_' };
#define grid_put_cell(gd, px, py, gc) do { \
memcpy(&gd->linedata[py].celldata[px], \
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c
index e2cdd144dca..ac0e73544f2 100644
--- a/usr.bin/tmux/screen-redraw.c
+++ b/usr.bin/tmux/screen-redraw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-redraw.c,v 1.21 2012/01/29 09:37:02 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.22 2012/05/23 19:19:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -202,9 +202,8 @@ screen_redraw_screen(struct client *c, int status_only, int borders_only)
}
/* Set up pane border attributes. */
- memcpy(&other_gc, &grid_default_cell, sizeof other_gc);
- memcpy(&active_gc, &grid_default_cell, sizeof active_gc);
- active_gc.data = other_gc.data = 'x'; /* not space */
+ memcpy(&other_gc, &grid_marker_cell, sizeof other_gc);
+ memcpy(&active_gc, &grid_marker_cell, sizeof active_gc);
active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET;
fg = options_get_number(oo, "pane-border-fg");
colour_set_fg(&other_gc, fg);
@@ -317,8 +316,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
px -= len * 3;
py -= 2;
- memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.data = '_'; /* not space */
+ memcpy(&gc, &grid_marker_cell, sizeof gc);
if (w->active == wp)
colour_set_bg(&gc, active_colour);
else
@@ -345,8 +343,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
tty_cursor(tty, xoff + wp->sx - len, yoff);
draw_text:
- memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.data = '_'; /* not space */
+ memcpy(&gc, &grid_marker_cell, sizeof gc);
if (w->active == wp)
colour_set_fg(&gc, active_colour);
else
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 47f3375b24c..16e44e6e58c 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.337 2012/05/22 14:32:28 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.338 2012/05/23 19:19:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1862,6 +1862,7 @@ int attributes_fromstring(const char *);
/* grid.c */
extern const struct grid_cell grid_default_cell;
+extern const struct grid_cell grid_marker_cell;
struct grid *grid_create(u_int, u_int, u_int);
void grid_destroy(struct grid *);
int grid_compare(struct grid *, struct grid *);