summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-05-27 23:06:12 +0000
committernicm <nicm@openbsd.org>2016-05-27 23:06:12 +0000
commit8ad773ea7f0a1c8ebfe519a37d45a4d7a5400cf0 (patch)
treed82e744654df4d25b32a2db29c35a9c39c73a49c /usr.bin/tmux/screen-write.c
parentBreak the save-last-cell code into a separate function (so it can be (diff)
downloadwireguard-openbsd-8ad773ea7f0a1c8ebfe519a37d45a4d7a5400cf0.tar.xz
wireguard-openbsd-8ad773ea7f0a1c8ebfe519a37d45a4d7a5400cf0.zip
Padding cell is always the same so use a static.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 96df0e98df9..4f04c56e021 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.87 2016/05/27 23:02:17 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.88 2016/05/27 23:06:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -32,6 +32,10 @@ static void screen_write_overwrite(struct screen_write_ctx *, u_int);
static int screen_write_combine(struct screen_write_ctx *,
const struct utf8_data *);
+static const struct grid_cell screen_write_pad_cell = {
+ GRID_FLAG_PADDING, 0, { .fg = 8 }, { .bg = 8 }, { { 0 }, 0, 0, 0 }
+};
+
/* Initialise writing with a window. */
void
screen_write_start(struct screen_write_ctx *ctx, struct window_pane *wp,
@@ -972,11 +976,8 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
* If the new character is UTF-8 wide, fill in padding cells. Have
* already ensured there is enough room.
*/
- memcpy(&tmp_gc, &grid_default_cell, sizeof tmp_gc);
- tmp_gc.flags |= GRID_FLAG_PADDING;
- tmp_gc.data.width = 0;
for (xx = s->cx + 1; xx < s->cx + width; xx++)
- grid_view_set_cell(gd, xx, s->cy, &tmp_gc);
+ grid_view_set_cell(gd, xx, s->cy, &screen_write_pad_cell);
/* Set the cell. */
grid_view_set_cell(gd, s->cx, s->cy, gc);