diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-03-26 19:07:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-03-26 19:07:33 +0000 |
commit | d74e5bffbad33df742749b5983479dc2cfac273b (patch) | |
tree | 1ec117f21ea5387a1a77559e520e6c07ff18aa46 /screen-write.c | |
parent | 54456d5602fb05ac30af0167242deaa44adf83ae (diff) | |
download | rtmux-d74e5bffbad33df742749b5983479dc2cfac273b.tar.gz rtmux-d74e5bffbad33df742749b5983479dc2cfac273b.tar.bz2 rtmux-d74e5bffbad33df742749b5983479dc2cfac273b.zip |
Fix to properly wrap wide characters, from Micah Cowan.
Diffstat (limited to 'screen-write.c')
-rw-r--r-- | screen-write.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/screen-write.c b/screen-write.c index 09f84bfd..fd4c7846 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1012,8 +1012,10 @@ screen_write_cell(struct screen_write_ctx *ctx, * If this is a wide character and there is no room on the screen, for * the entire character, don't print it. */ - if (width > 1 && (width > screen_size_x(s) || - (s->cx != screen_size_x(s) && s->cx > screen_size_x(s) - width))) + if (!(s->mode & MODE_WRAP) + && (width > 1 && (width > screen_size_x(s) || + (s->cx != screen_size_x(s) + && s->cx > screen_size_x(s) - width)))) return; /* @@ -1045,8 +1047,8 @@ screen_write_cell(struct screen_write_ctx *ctx, } /* Sanity checks. */ - if (((s->mode & MODE_WRAP) && s->cx > screen_size_x(s) - 1) - || s->cy > screen_size_y(s) - 1) + if (((s->mode & MODE_WRAP) && s->cx > screen_size_x(s) - width) + || s->cy > screen_size_y(s) - width) return; /* Handle overwriting of UTF-8 characters. */ |