… | |
… | |
325 | qline->l = ncol; |
325 | qline->l = ncol; |
326 | qline->is_longer (1); |
326 | qline->is_longer (1); |
327 | |
327 | |
328 | int qcol = 0; |
328 | int qcol = 0; |
329 | |
329 | |
|
|
330 | // see below for cursor adjustment rationale |
|
|
331 | if (p == ocur.row) |
|
|
332 | screen.cur.row = q - (total_rows - nrow); |
|
|
333 | |
330 | // fill a single destination line |
334 | // fill a single destination line |
331 | while (lofs < llen && qcol < ncol) |
335 | while (lofs < llen && qcol < ncol) |
332 | { |
336 | { |
333 | int prow = lofs / prev_ncol; |
337 | int prow = lofs / prev_ncol; |
334 | int pcol = lofs % prev_ncol; |
338 | int pcol = lofs % prev_ncol; |
… | |
… | |
388 | row_buf [row].clear (); scr_blank_screen_mem (row_buf [row], DEFAULT_RSTYLE); |
392 | row_buf [row].clear (); scr_blank_screen_mem (row_buf [row], DEFAULT_RSTYLE); |
389 | } |
393 | } |
390 | |
394 | |
391 | term_start = 0; |
395 | term_start = 0; |
392 | } |
396 | } |
393 | |
|
|
394 | #ifdef DEBUG_STRICT //TODO: remove |
|
|
395 | for (int i = top_row; i < nrow; i++) |
|
|
396 | assert (ROW (i).t); |
|
|
397 | #endif |
|
|
398 | |
397 | |
399 | free (old_buf); |
398 | free (old_buf); |
400 | delete old_ta; |
399 | delete old_ta; |
401 | delete old_ra; |
400 | delete old_ra; |
402 | |
401 | |
… | |
… | |
620 | top_row = max (top_row - count, -saveLines); |
619 | top_row = max (top_row - count, -saveLines); |
621 | |
620 | |
622 | // scroll everything up 'count' lines |
621 | // scroll everything up 'count' lines |
623 | term_start = (term_start + count) % total_rows; |
622 | term_start = (term_start + count) % total_rows; |
624 | |
623 | |
|
|
624 | // sever bottommost line |
625 | { |
625 | { |
626 | // severe bottommost scrolled line |
|
|
627 | line_t &l = ROW(row2 - count); |
626 | line_t &l = ROW(row2 - count); |
|
|
627 | l.is_longer (0); |
628 | l.touch (); |
628 | l.touch (); |
629 | l.is_longer (0); |
|
|
630 | } |
629 | } |
631 | |
630 | |
632 | // erase newly scorlled-in lines |
631 | // erase newly scrolled-in lines |
633 | for (int i = count; i; --i ) |
632 | for (int i = count; i--; ) |
634 | { |
633 | { |
635 | // basically this is a slightly optimized scr_blank_screen_mem |
634 | // basically this is a slightly optimized scr_blank_screen_mem |
636 | // it is worth the effort on slower machines |
635 | // it is worth the effort on slower machines |
637 | line_t &l = ROW(nrow - i); |
636 | line_t &l = ROW(nrow - 1 - i); |
638 | |
637 | |
639 | scr_blank_line (l, 0, l.l, rstyle); |
638 | scr_blank_line (l, 0, l.l, rstyle); |
640 | |
639 | |
641 | l.l = 0; |
640 | l.l = 0; |
642 | l.f = 0; |
641 | l.f = 0; |
… | |
… | |
817 | CLEAR_SELECTION (); |
816 | CLEAR_SELECTION (); |
818 | } |
817 | } |
819 | |
818 | |
820 | if (screen.flags & Screen_WrapNext) |
819 | if (screen.flags & Screen_WrapNext) |
821 | { |
820 | { |
822 | max_it (line->l, ncol); |
|
|
823 | line->is_longer (1); |
|
|
824 | |
|
|
825 | scr_do_wrap (); |
821 | scr_do_wrap (); |
826 | |
822 | |
|
|
823 | line->l = ncol; |
|
|
824 | line->is_longer (1); |
|
|
825 | |
827 | row = screen.cur.row; |
826 | row = screen.cur.row; |
828 | line = &ROW(row); /* _must_ refresh */ |
827 | line = &ROW(row); /* _must_ refresh */ |
829 | } |
828 | } |
830 | |
829 | |
831 | // some utf-8 decoders "decode" surrogate characters: let's fix this. |
830 | // some utf-8 decoders "decode" surrogate characters: let's fix this. |
… | |
… | |
2800 | * (+) if ownership is claimed but property is empty, rxvt_selection_paste () |
2799 | * (+) if ownership is claimed but property is empty, rxvt_selection_paste () |
2801 | * will auto fallback to CUT_BUFFER0 |
2800 | * will auto fallback to CUT_BUFFER0 |
2802 | * EXT: button 2 release |
2801 | * EXT: button 2 release |
2803 | */ |
2802 | */ |
2804 | void |
2803 | void |
2805 | rxvt_term::selection_request (Time tm, int x, int y) |
2804 | rxvt_term::selection_request (Time tm) |
2806 | { |
2805 | { |
2807 | if (x < 0 || x >= width || y < 0 || y >= height) |
|
|
2808 | return; /* outside window */ |
|
|
2809 | |
|
|
2810 | if (selection.text) |
2806 | if (selection.text) |
2811 | { /* internal selection */ |
2807 | { /* internal selection */ |
2812 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2808 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2813 | paste (str, strlen (str)); |
2809 | paste (str, strlen (str)); |
2814 | free (str); |
2810 | free (str); |