… | |
… | |
203 | term_start = 0; |
203 | term_start = 0; |
204 | |
204 | |
205 | talloc = new rxvt_salloc (ncol * sizeof (text_t)); |
205 | talloc = new rxvt_salloc (ncol * sizeof (text_t)); |
206 | ralloc = new rxvt_salloc (ncol * sizeof (rend_t)); |
206 | ralloc = new rxvt_salloc (ncol * sizeof (rend_t)); |
207 | |
207 | |
208 | row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t)); |
208 | row_buf = (line_t *)rxvt_calloc (total_rows , sizeof (line_t)); |
209 | drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); |
209 | drawn_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); |
210 | swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); |
210 | swap_buf = (line_t *)rxvt_calloc (nrow , sizeof (line_t)); |
211 | |
211 | |
212 | for (int row = nrow; row--; ) |
212 | for (int row = nrow; row--; ) |
213 | { |
213 | { |
… | |
… | |
275 | swap_buf [row].clear (); scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); |
275 | swap_buf [row].clear (); scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); |
276 | drawn_buf[row].clear (); scr_blank_screen_mem (drawn_buf[row], DEFAULT_RSTYLE); |
276 | drawn_buf[row].clear (); scr_blank_screen_mem (drawn_buf[row], DEFAULT_RSTYLE); |
277 | } |
277 | } |
278 | |
278 | |
279 | line_t *old_buf = row_buf; |
279 | line_t *old_buf = row_buf; |
280 | row_buf = (line_t *)rxvt_calloc (total_rows + nrow, sizeof (line_t)); |
280 | row_buf = (line_t *)rxvt_calloc (total_rows, sizeof (line_t)); |
281 | |
281 | |
282 | int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row |
282 | int p = MOD (term_start + prev_nrow, prev_total_rows); // previous row |
283 | int pend = MOD (term_start + top_row , prev_total_rows); |
283 | int pend = MOD (term_start + top_row , prev_total_rows); |
284 | int q = total_rows; // rewrapped row |
284 | int q = total_rows; // rewrapped row |
285 | |
285 | |
… | |
… | |
644 | |
644 | |
645 | top_row = max (top_row - count, -saveLines); |
645 | top_row = max (top_row - count, -saveLines); |
646 | |
646 | |
647 | // sever bottommost line |
647 | // sever bottommost line |
648 | { |
648 | { |
649 | line_t &l = ROW(row2 - 1); |
649 | line_t &l = ROW(row2); |
650 | l.is_longer (0); |
650 | l.is_longer (0); |
651 | l.touch (); |
651 | l.touch (); |
652 | } |
652 | } |
653 | |
653 | |
654 | // scroll everything up 'count' lines |
654 | // scroll everything up 'count' lines |
… | |
… | |
734 | } |
734 | } |
735 | |
735 | |
736 | // use a simple and robust scrolling algorithm, this |
736 | // use a simple and robust scrolling algorithm, this |
737 | // part of scr_scroll_text is not time-critical. |
737 | // part of scr_scroll_text is not time-critical. |
738 | |
738 | |
|
|
739 | // sever line above scroll region |
|
|
740 | if (row1) |
|
|
741 | { |
|
|
742 | line_t &l = ROW(row1 - 1); |
|
|
743 | l.is_longer (0); |
|
|
744 | l.touch (); |
|
|
745 | } |
|
|
746 | |
739 | int rows = row2 - row1 + 1; |
747 | int rows = row2 - row1 + 1; |
740 | |
748 | |
741 | min_it (count, rows); |
749 | min_it (count, rows); |
742 | |
750 | |
743 | line_t *temp_buf = row_buf + total_rows; |
751 | line_t *temp_buf = rxvt_temp_buf<line_t> (rows); |
744 | |
752 | |
745 | for (int row = 0; row < rows; row++) |
753 | for (int row = 0; row < rows; row++) |
746 | { |
754 | { |
747 | temp_buf [row] = ROW(row1 + (row + count + rows) % rows); |
755 | temp_buf [row] = ROW(row1 + (row + count + rows) % rows); |
748 | |
756 | |
… | |
… | |
750 | scr_blank_screen_mem (temp_buf [row], rstyle); |
758 | scr_blank_screen_mem (temp_buf [row], rstyle); |
751 | } |
759 | } |
752 | |
760 | |
753 | for (int row = 0; row < rows; row++) |
761 | for (int row = 0; row < rows; row++) |
754 | ROW(row1 + row) = temp_buf [row]; |
762 | ROW(row1 + row) = temp_buf [row]; |
|
|
763 | |
|
|
764 | // sever bottommost line |
|
|
765 | { |
|
|
766 | line_t &l = ROW(row2); |
|
|
767 | l.is_longer (0); |
|
|
768 | l.touch (); |
|
|
769 | } |
755 | } |
770 | } |
756 | |
771 | |
757 | return count; |
772 | return count; |
758 | } |
773 | } |
759 | |
774 | |
… | |
… | |
2548 | { |
2563 | { |
2549 | if (transparent) |
2564 | if (transparent) |
2550 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
2565 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
2551 | else |
2566 | else |
2552 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); |
2567 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); |
2553 | scrollBar.state = STATE_IDLE; |
2568 | scrollBar.state = SB_STATE_IDLE; |
2554 | scrollBar.show (0); |
2569 | scrollBar.show (0); |
2555 | } |
2570 | } |
2556 | |
2571 | |
2557 | if (refresh) |
2572 | if (refresh) |
2558 | { |
2573 | { |
… | |
… | |
2702 | || (check_more == 3 |
2717 | || (check_more == 3 |
2703 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2718 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2704 | || (check_more == 4 /* screen width change */ |
2719 | || (check_more == 4 /* screen width change */ |
2705 | && (selection.beg.row != selection.end.row |
2720 | && (selection.beg.row != selection.end.row |
2706 | || selection.end.col > ncol))) |
2721 | || selection.end.col > ncol))) |
2707 | CLEAR_SELECTION (); |
2722 | CLEAR_ALL_SELECTION (); |
2708 | } |
2723 | } |
2709 | |
2724 | |
2710 | /* ------------------------------------------------------------------------- */ |
2725 | /* ------------------------------------------------------------------------- */ |
2711 | /* |
2726 | /* |
2712 | * Paste a selection direct to the command fd |
2727 | * Paste a selection direct to the command fd |