summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/grid.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-06-02 20:10:24 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-06-02 20:10:24 +0000
commit501f8883d2d4fc63891cacf57efb2b92e9d523fe (patch)
tree76a94802b7c13fe9e134bfa8920e71e91f549c83 /usr.bin/tmux/grid.c
parent18556bc5979389d5e142757611b64696fda77d83 (diff)
Allow UTF-8 characters of width 0 to be stored, it is useful to be able
to put padding cells in as width 0.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r--usr.bin/tmux/grid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c
index f9d60585054..a16b004502a 100644
--- a/usr.bin/tmux/grid.c
+++ b/usr.bin/tmux/grid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid.c,v 1.114 2020/05/27 06:23:23 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.115 2020/06/02 20:10:23 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -76,7 +76,7 @@ grid_need_extended_cell(const struct grid_cell_entry *gce,
return (1);
if (gc->attr > 0xff)
return (1);
- if (gc->data.size > 1 || gc->data.width > 1)
+ if (gc->data.size != 1 || gc->data.width != 1)
return (1);
if ((gc->fg & COLOUR_FLAG_RGB) || (gc->bg & COLOUR_FLAG_RGB))
return (1);
@@ -570,7 +570,7 @@ grid_set_cells(struct grid *gd, u_int px, u_int py, const struct grid_cell *gc,
gce = &gl->celldata[px + i];
if (grid_need_extended_cell(gce, gc)) {
gee = grid_extended_cell(gl, gce, gc);
- gee->data = utf8_build_one(s[i], 1);
+ gee->data = utf8_build_one(s[i]);
} else
grid_store_cell(gce, gc, s[i]);
}