--- rxvt-unicode/src/screen.C 2010/07/26 09:57:53 1.346 +++ rxvt-unicode/src/screen.C 2010/10/15 11:07:45 1.351 @@ -900,6 +900,22 @@ # endif #endif + rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); + + // if the character doesn't fit into the remaining columns... + if (expect_false (screen.cur.col > ncol - width && ncol >= width)) + { + if (screen.flags & Screen_Autowrap) + { + // ... artificially enlargen the previous one + c = NOCHAR; + // and try the same character next loop iteration + --str; + } + else + screen.cur.col = ncol - width; + } + // nuke the character at this position, if required if (expect_false ( line->t[screen.cur.col] == NOCHAR @@ -908,17 +924,6 @@ )) scr_kill_char (*line, screen.cur.col); - rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c)); - - // if the character doesn't fit into the remaining columns... - if (expect_false (screen.cur.col > ncol - width && ncol >= width)) - { - // ... artificially enlargen the previous one - c = NOCHAR; - // and try the same character next loop iteration - --str; - } - line->touch (); do @@ -1023,6 +1028,8 @@ #endif } } + else if (screen.flags & Screen_WrapNext) + screen.flags &= ~Screen_WrapNext; else scr_gotorc (0, -1, RELATIVE); } @@ -1338,16 +1345,13 @@ min_it (num, nrow - row); - // TODO: the code below does not work when view_start != 0 - // the workaround is to disable the clear and use a normal refresh - // when view_start != 0. mysterious. if (rstyle & (RS_Blink | RS_RVid | RS_Uline)) ren = (rend_t) ~RS_None; else if (GET_BASEBG (rstyle) == Color_bg) { ren = DEFAULT_RSTYLE; - if (mapped && !view_start) + if (mapped) XClearArea (dpy, vt, 0, Row2Pixel (row - view_start), (unsigned int)width, (unsigned int)Height2Pixel (num), False); @@ -1356,7 +1360,7 @@ { ren = rstyle & (RS_fgMask | RS_bgMask); - if (mapped && !view_start) + if (mapped) { gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; XChangeGC (dpy, gc, GCForeground, &gcvalue); @@ -1373,8 +1377,8 @@ { scr_blank_screen_mem (ROW(row), rstyle); - if (!view_start) - scr_blank_line (drawn_buf [row], 0, ncol, ren); + if (row - view_start < nrow) + scr_blank_line (drawn_buf [row - view_start], 0, ncol, ren); } }