=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/screen-write.c 2009/10/17 08:24:46 1.31 --- src/usr.bin/tmux/screen-write.c 2009/10/17 08:32:18 1.32 *************** *** 1,4 **** ! /* $OpenBSD: screen-write.c,v 1.31 2009/10/17 08:24:46 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen-write.c,v 1.32 2009/10/17 08:32:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1006,1011 **** --- 1006,1019 ---- } else width = 1; + /* + * 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))) + return; + /* If the width is zero, combine onto the previous character. */ if (width == 0) { if (s->cx == 0) *************** *** 1035,1048 **** ttyctx.ptr = udata; tty_write(tty_cmd_utf8character, &ttyctx); return; - } - - /* If the character is wider than the screen, don't print it. */ - if (width > screen_size_x(s)) { - memcpy(&tmp_gc, gc, sizeof tmp_gc); - tmp_gc.data = '_'; - width = 1; - gc = &tmp_gc; } /* Initialise the redraw context, saving the last cell. */ --- 1043,1048 ----