--- rxvt-unicode/src/screen.C 2006/01/22 20:39:47 1.247 +++ rxvt-unicode/src/screen.C 2006/01/25 13:24:45 1.250 @@ -760,6 +760,7 @@ if (minlines > 0) { minlines += screen.cur.row - screen.bscroll; + min_it (minlines, screen.cur.row - top_row); if (minlines > 0 && screen.tscroll == 0 @@ -843,11 +844,11 @@ if (IN_RANGE_INC (c, 0xd800, 0xdfff)) c = 0xfffd; - // rely on wcwidth to tell us the character width, at least for non-latin1 - // do wcwidth before further replacements, as wcwidth might return -1 - // for the line drawing characters below as they might be invalid in the current + // rely on wcwidth to tell us the character width, do wcwidth before + // further replacements, as wcwidth might return -1 for the line + // drawing characters below as they might be invalid in the current // locale. - int width = c < 0x100 ? 1 : wcwidth (c); + int width = WCWIDTH (c); if (charsets [screen.charset] == '0') // DEC SPECIAL { @@ -2245,15 +2246,21 @@ if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) { #if ENABLE_STYLES - // force redraw after "careful" characters to avoid pixel droppings - if (srp[col] & RS_Careful && col < ncol - 1 && 0) - drp[col + 1] = ~srp[col + 1]; + // "careful" (too wide) character handling // include previous careful character(s) if possible, looks nicer (best effort...) while (text > stp && srp[text - stp - 1] & RS_Careful && RS_SAME (rend, srp[text - stp - 1])) text--, count++, xpixel -= fwidth; + + // force redraw after "careful" characters to avoid pixel droppings + for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) + drp[col + i + 1] = ~srp[col + i + 1]; + + // force redraw before "careful" characters to avoid pixel droppings + for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) + drp[text - stp - i - 1] = ~srp[text - stp - i - 1]; #endif bool invert = rend & RS_RVid; @@ -3765,7 +3772,7 @@ while (*s) { text_t t = *s++; - int width = wcwidth (t); + int width = WCWIDTH (t); while (width--) {