--- rxvt-unicode/src/screen.C 2013/03/25 15:41:07 1.438 +++ rxvt-unicode/src/screen.C 2013/03/30 08:47:06 1.442 @@ -717,7 +717,7 @@ if (option (Opt_scrollWithBuffer) && view_start != 0 && view_start != -saveLines) - scr_page (UP, count); + scr_page (count); if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); @@ -1242,20 +1242,16 @@ void rxvt_term::scr_index (enum page_dirn direction) NOTHROW { - int dirn; - want_refresh = 1; ZERO_SCROLLBACK (); - dirn = ((direction == UP) ? 1 : -1); - screen.flags &= ~Screen_WrapNext; if ((screen.cur.row == screen.bscroll && direction == UP) || (screen.cur.row == screen.tscroll && direction == DN)) - scr_scroll_text (screen.tscroll, screen.bscroll, dirn); + scr_scroll_text (screen.tscroll, screen.bscroll, direction); else - screen.cur.row += dirn; + screen.cur.row += direction; clamp_it (screen.cur.row, 0, nrow - 1); selection_check (0); @@ -1912,13 +1908,9 @@ * direction should be UP or DN */ bool -rxvt_term::scr_page (enum page_dirn direction, int nlines) NOTHROW +rxvt_term::scr_page (int nlines) NOTHROW { - int new_view_start = - direction == UP ? view_start - nlines - : view_start + nlines; - - return scr_changeview (new_view_start); + return scr_changeview (view_start - nlines); } bool @@ -2085,8 +2077,6 @@ * C: set the cursor character (s) */ { - bool setoldcursor; - #ifdef CURSOR_BLINK if (hidden_cursor) showcursor = 0; @@ -2147,7 +2137,6 @@ } /* make sure no outline cursor is left around */ - setoldcursor = 0; if (ocrow != -1) { if (screen.cur.row - view_start != ocrow @@ -2156,26 +2145,19 @@ if (ocrow < nrow && oldcursor.col < ncol) drawn_buf[ocrow].r[oldcursor.col] ^= (RS_RVid | RS_Uline); - - if (focus || !showcursor) - oldcursor.row = -1; - else - setoldcursor = 1; } } - else if (!focus) - setoldcursor = 1; - if (setoldcursor) + // save the current cursor coordinates if the cursor is visible + // and the window is unfocused, so as to clear the outline cursor + // in the next refresh if the cursor moves + if (showcursor && !focus && screen.cur.row - view_start < nrow) { - if (screen.cur.row - view_start >= nrow) - oldcursor.row = -1; - else - { - oldcursor.row = screen.cur.row - view_start; - oldcursor.col = screen.cur.col; - } + oldcursor.row = screen.cur.row - view_start; + oldcursor.col = screen.cur.col; } + else + oldcursor.row = -1; } #ifndef NO_SLOW_LINK_SUPPORT @@ -3092,6 +3074,14 @@ if (dirn == DN) col++; /* put us on one past the end */ + else + { + // if the delimiter on the left has width > 1 col points to the + // first NOCHAR in the delimiter cell and so we must move it to the + // beginning of the next cell. + while (ROW(row).t[col] == NOCHAR) + col++; + } /* Poke the values back in */ ret->row = row;