… | |
… | |
682 | else |
682 | else |
683 | scr_blank_screen_mem (l, rstyle); |
683 | scr_blank_screen_mem (l, rstyle); |
684 | } |
684 | } |
685 | |
685 | |
686 | // move and/or clear selection, if any |
686 | // move and/or clear selection, if any |
687 | if (selection.op && current_screen == selection.screen) |
687 | if (selection.op && current_screen == selection.screen |
|
|
688 | && selection.beg.row <= row2) |
688 | { |
689 | { |
689 | selection.beg.row -= count; |
690 | selection.beg.row -= count; |
690 | selection.end.row -= count; |
691 | selection.end.row -= count; |
691 | selection.mark.row -= count; |
692 | selection.mark.row -= count; |
692 | |
693 | |
… | |
… | |
774 | rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW |
775 | rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW |
775 | { |
776 | { |
776 | if (len <= 0) /* sanity */ |
777 | if (len <= 0) /* sanity */ |
777 | return; |
778 | return; |
778 | |
779 | |
779 | unsigned char checksel; |
780 | bool checksel; |
780 | unicode_t c; |
781 | unicode_t c; |
781 | int ncol = this->ncol; |
782 | int ncol = this->ncol; |
782 | const wchar_t *strend = str + len; |
783 | const wchar_t *strend = str + len; |
783 | |
784 | |
784 | want_refresh = 1; |
785 | want_refresh = 1; |
… | |
… | |
1325 | ZERO_SCROLLBACK (); |
1326 | ZERO_SCROLLBACK (); |
1326 | |
1327 | |
1327 | switch (mode) |
1328 | switch (mode) |
1328 | { |
1329 | { |
1329 | case 0: /* erase to end of screen */ |
1330 | case 0: /* erase to end of screen */ |
1330 | selection_check (1); |
|
|
1331 | scr_erase_line (0); |
1331 | scr_erase_line (0); |
1332 | row = screen.cur.row + 1; /* possible OOB */ |
1332 | row = screen.cur.row + 1; /* possible OOB */ |
1333 | num = nrow - row; |
1333 | num = nrow - row; |
1334 | break; |
1334 | break; |
1335 | case 1: /* erase to beginning of screen */ |
1335 | case 1: /* erase to beginning of screen */ |
1336 | selection_check (3); |
|
|
1337 | scr_erase_line (1); |
1336 | scr_erase_line (1); |
1338 | row = 0; |
1337 | row = 0; |
1339 | num = screen.cur.row; |
1338 | num = screen.cur.row; |
1340 | break; |
1339 | break; |
1341 | case 2: /* erase whole screen */ |
1340 | case 2: /* erase whole screen */ |
1342 | selection_check (3); |
|
|
1343 | row = 0; |
1341 | row = 0; |
1344 | num = nrow; |
1342 | num = nrow; |
1345 | break; |
1343 | break; |
1346 | default: |
1344 | default: |
1347 | return; |
1345 | return; |
… | |
… | |
2041 | * A: set up vars |
2039 | * A: set up vars |
2042 | */ |
2040 | */ |
2043 | refresh_count = 0; |
2041 | refresh_count = 0; |
2044 | |
2042 | |
2045 | unsigned int old_screen_flags = screen.flags; |
2043 | unsigned int old_screen_flags = screen.flags; |
2046 | char have_bg = 0; |
2044 | bool have_bg = 0; |
2047 | #ifdef HAVE_BG_PIXMAP |
2045 | #ifdef HAVE_BG_PIXMAP |
2048 | have_bg = bg_pixmap != None; |
2046 | have_bg = bg_pixmap != None; |
2049 | #endif |
2047 | #endif |
2050 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2048 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2051 | |
2049 | |
… | |
… | |
2057 | HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
2055 | HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); |
2058 | #if ENABLE_OVERLAY |
2056 | #if ENABLE_OVERLAY |
2059 | scr_swap_overlay (); |
2057 | scr_swap_overlay (); |
2060 | #endif |
2058 | #endif |
2061 | |
2059 | |
2062 | char showcursor = screen.flags & Screen_VisibleCursor; |
2060 | bool showcursor = screen.flags & Screen_VisibleCursor; |
2063 | |
2061 | |
2064 | /* |
2062 | /* |
2065 | * C: set the cursor character (s) |
2063 | * C: set the cursor character (s) |
2066 | */ |
2064 | */ |
2067 | { |
2065 | { |
2068 | unsigned char setoldcursor; |
2066 | bool setoldcursor; |
2069 | |
2067 | |
2070 | #ifdef CURSOR_BLINK |
2068 | #ifdef CURSOR_BLINK |
2071 | if (hidden_cursor) |
2069 | if (hidden_cursor) |
2072 | showcursor = 0; |
2070 | showcursor = 0; |
2073 | #endif |
2071 | #endif |
… | |
… | |
2690 | * CHARACTER SELECTION * |
2688 | * CHARACTER SELECTION * |
2691 | * ------------------------------------------------------------------------- */ |
2689 | * ------------------------------------------------------------------------- */ |
2692 | void |
2690 | void |
2693 | rxvt_term::selection_check (int check_more) NOTHROW |
2691 | rxvt_term::selection_check (int check_more) NOTHROW |
2694 | { |
2692 | { |
2695 | row_col_t pos; |
|
|
2696 | |
|
|
2697 | if (!selection.op) |
2693 | if (!selection.op) |
2698 | return; |
2694 | return; |
2699 | |
2695 | |
|
|
2696 | row_col_t pos; |
2700 | pos.row = pos.col = 0; |
2697 | pos.row = pos.col = 0; |
|
|
2698 | |
2701 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2699 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2702 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2700 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2703 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2701 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2704 | || (check_more == 1 |
2702 | || (check_more == 1 |
2705 | && current_screen == selection.screen |
2703 | && current_screen == selection.screen |
… | |
… | |
2707 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2705 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2708 | || (check_more == 2 |
2706 | || (check_more == 2 |
2709 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2707 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2710 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2708 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2711 | || (check_more == 3 |
2709 | || (check_more == 3 |
2712 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2710 | && ROWCOL_IS_AFTER (selection.end, pos))) |
2713 | || (check_more == 4 /* screen width change */ |
|
|
2714 | && (selection.beg.row != selection.end.row |
|
|
2715 | || selection.end.col > ncol))) |
|
|
2716 | CLEAR_ALL_SELECTION (); |
2711 | CLEAR_ALL_SELECTION (); |
2717 | } |
2712 | } |
2718 | |
2713 | |
2719 | /* ------------------------------------------------------------------------- */ |
2714 | /* ------------------------------------------------------------------------- */ |
2720 | /* |
2715 | /* |