--- rxvt-unicode/src/screen.C 2006/01/06 05:37:59 1.212 +++ rxvt-unicode/src/screen.C 2006/01/09 18:51:19 1.216 @@ -147,6 +147,9 @@ rxvt_term::scr_blank_screen_mem (line_t &l, rend_t efs) { scr_blank_line (l, 0, ncol, efs); + + l.l = 0; + l.f = 0; } /* ------------------------------------------------------------------------- * @@ -641,8 +644,14 @@ for (int i = count; i--; ) { - ROW(row2 - i).l = 0; - scr_blank_screen_mem (ROW(row2 - i), rstyle); + // basically thi is a slightly optimized scr_blank_screen_mem + // it is worth the effort on slower machines + line_t &l = ROW(row2 - i); + + scr_blank_line (l, 0, l.l, rstyle); + + l.l = 0; + l.f = 0; } if (OPTION (Opt_scrollWithBuffer) @@ -702,7 +711,7 @@ * Add text given in of length to screen struct */ void -rxvt_term::scr_add_lines (const unicode_t *str, int nlines, int len) +rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) { if (len <= 0) /* sanity */ return; @@ -710,22 +719,22 @@ unsigned char checksel; unicode_t c; int ncol = this->ncol; - const unicode_t *strend = str + len; + const wchar_t *strend = str + len; want_refresh = 1; ZERO_SCROLLBACK (); - if (nlines > 0) + if (minlines > 0) { - nlines += screen.cur.row - screen.bscroll; + minlines += screen.cur.row - screen.bscroll; - if (nlines > 0 + if (minlines > 0 && screen.tscroll == 0 && screen.bscroll == nrow - 1) { /* _at least_ this many lines need to be scrolled */ - scr_scroll_text (screen.tscroll, screen.bscroll, nlines); - screen.cur.row -= nlines; + scr_scroll_text (screen.tscroll, screen.bscroll, minlines); + screen.cur.row -= minlines; } } @@ -742,7 +751,7 @@ while (str < strend) { - c = *str++; + c = (unicode_t)*str++; // convert to rxvt-unicodes representation if (c < 0x20) if (c == C0_LF) @@ -1305,10 +1314,7 @@ for (; num--; row++) { - line_t &l = ROW(row); - l.l = 0; - l.is_longer (0); - scr_blank_screen_mem (l, rstyle); + scr_blank_screen_mem (ROW(row), rstyle); scr_blank_line (drawn_buf [row], 0, ncol, ren); } } @@ -2390,7 +2396,7 @@ if (!l.t) return; - l.touch (); // maybe a bit of an overkill, but its not performance-relevant + l.touch (); // maybe a bit of an overkill, but it's not performance-relevant for (int i = ncol; i--; ) l.r[i] = SET_FONT (l.r[i], FONTSET (l.r[i])->find_font (l.t[i]));