From 501f8883d2d4fc63891cacf57efb2b92e9d523fe Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 2 Jun 2020 20:10:24 +0000 Subject: Allow UTF-8 characters of width 0 to be stored, it is useful to be able to put padding cells in as width 0. --- usr.bin/tmux/grid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/tmux/grid.c') 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 @@ -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]); } -- cgit v1.2.3