--- rxvt-unicode/src/screen.C 2006/01/17 05:47:42 1.235 +++ rxvt-unicode/src/screen.C 2006/01/19 17:37:01 1.241 @@ -236,7 +236,6 @@ selection.op = SELECTION_CLEAR; selection.screen = PRIMARY; selection.clicks = 0; - CLEAR_ALL_SELECTION (); rvideo = 0; } else @@ -327,6 +326,10 @@ int qcol = 0; + // see below for cursor adjustment rationale + if (p == ocur.row) + screen.cur.row = q - (total_rows - nrow); + // fill a single destination line while (lofs < llen && qcol < ncol) { @@ -346,8 +349,10 @@ int len = min (min (prev_ncol - pcol, ncol - qcol), llen - lofs); +#if DEBUG_STRICT assert (len); assert (pline.t); +#endif memcpy (qline->t + qcol, pline.t + pcol, len * sizeof (text_t)); memcpy (qline->r + qcol, pline.r + pcol, len * sizeof (rend_t)); @@ -391,11 +396,6 @@ term_start = 0; } -#ifdef DEBUG_STRICT //TODO: remove - for (int i = top_row; i < nrow; i++) - assert (ROW (i).t); -#endif - free (old_buf); delete old_ta; delete old_ra; @@ -407,6 +407,8 @@ free (tabs); } + CLEAR_ALL_SELECTION (); + prev_nrow = nrow; prev_ncol = ncol; @@ -622,19 +624,19 @@ // scroll everything up 'count' lines term_start = (term_start + count) % total_rows; + // sever bottommost line { - // severe bottommost scrolled line line_t &l = ROW(row2 - count); - l.touch (); l.is_longer (0); + l.touch (); } - // erase newly scorlled-in lines - for (int i = count; i; --i ) + // erase newly scrolled-in lines + for (int i = count; i--; ) { // basically this is a slightly optimized scr_blank_screen_mem // it is worth the effort on slower machines - line_t &l = ROW(nrow - i); + line_t &l = ROW(nrow - 1 - i); scr_blank_line (l, 0, l.l, rstyle); @@ -819,11 +821,11 @@ if (screen.flags & Screen_WrapNext) { - max_it (line->l, ncol); - line->is_longer (1); - scr_do_wrap (); + line->l = ncol; + line->is_longer (1); + row = screen.cur.row; line = &ROW(row); /* _must_ refresh */ } @@ -2802,11 +2804,8 @@ * EXT: button 2 release */ void -rxvt_term::selection_request (Time tm, int x, int y) +rxvt_term::selection_request (Time tm) { - if (x < 0 || x >= width || y < 0 || y >= height) - return; /* outside window */ - if (selection.text) { /* internal selection */ char *str = rxvt_wcstombs (selection.text, selection.len);