--- rxvt-unicode/src/screen.C 2011/07/08 20:54:31 1.390 +++ rxvt-unicode/src/screen.C 2011/11/02 11:56:52 1.397 @@ -646,7 +646,7 @@ // sever bottommost line { - line_t &l = ROW(row2 - 1); + line_t &l = ROW(row2); l.is_longer (0); l.touch (); } @@ -690,13 +690,7 @@ selection.end.row -= count; selection.mark.row -= count; - if (selection.beg.row < top_row - || selection.end.row < top_row - || selection.mark.row < top_row) - { - CLEAR_ALL_SELECTION (); - selection.op = SELECTION_CLEAR; - } + selection_check (0); } // finally move the view window, if desired @@ -763,11 +757,10 @@ // sever bottommost line { - line_t &l = ROW(row2 - 1); + line_t &l = ROW(row2); l.is_longer (0); l.touch (); } - } return count; @@ -2566,7 +2559,7 @@ XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); else XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); - scrollBar.state = STATE_IDLE; + scrollBar.state = SB_STATE_IDLE; scrollBar.show (0); } @@ -2699,12 +2692,12 @@ void rxvt_term::selection_check (int check_more) NOTHROW { - row_col_t pos; - if (!selection.op) return; + row_col_t pos; pos.row = pos.col = 0; + if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) || !IN_RANGE_EXC (selection.end.row, top_row, nrow) @@ -2720,7 +2713,7 @@ || (check_more == 4 /* screen width change */ && (selection.beg.row != selection.end.row || selection.end.col > ncol))) - CLEAR_SELECTION (); + CLEAR_ALL_SELECTION (); } /* ------------------------------------------------------------------------- */