aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/screen-write.c b/screen-write.c
index 07f348ba..c1514238 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1,4 +1,4 @@
-/* $Id: screen-write.c,v 1.26 2009-01-18 21:21:53 nicm Exp $ */
+/* $Id: screen-write.c,v 1.27 2009-01-18 21:46:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -514,7 +514,11 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
const struct grid_cell *hc;
struct grid_cell *ic, tc;
- width = utf8_width(gc->data);
+ /* Find character width. */
+ if (gc->flags & GRID_FLAG_UTF8)
+ width = utf8_width(gc->data);
+ else
+ width = 1;
/* If the character is wider than the screen, don't print it. */
if (width > screen_size_x(s)) {
@@ -570,7 +574,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
break;
grid_view_set_cell(gd, xx, s->cy, &grid_default_cell);
}
- } else if (utf8_width(hc->data) > 1) {
+ } else if (hc->flags & GRID_FLAG_UTF8 && utf8_width(hc->data) > 1) {
/*
* An UTF-8 wide cell; overwrite following padding cells only.
*/
@@ -593,6 +597,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
ic->flags |= GRID_FLAG_PADDING;
}
+not_utf8:
/* Write the actual cell. */
grid_view_set_cell(gd, s->cx, s->cy, gc);