… | |
… | |
49 | if (option (Opt_scrollTtyOutput)) \ |
49 | if (option (Opt_scrollTtyOutput)) \ |
50 | view_start = 0 |
50 | view_start = 0 |
51 | #define CLEAR_SELECTION() \ |
51 | #define CLEAR_SELECTION() \ |
52 | selection.beg.row = selection.beg.col \ |
52 | selection.beg.row = selection.beg.col \ |
53 | = selection.end.row = selection.end.col = 0 |
53 | = selection.end.row = selection.end.col = 0 |
54 | #define CLEAR_SELECTION_MARK() \ |
54 | #define CLEAR_ALL_SELECTION() \ |
|
|
55 | selection.beg.row = selection.beg.col \ |
|
|
56 | = selection.mark.row = selection.mark.col \ |
55 | selection.mark.row = selection.mark.col = 0 |
57 | = selection.end.row = selection.end.col = 0 |
56 | |
58 | |
57 | #define ROW_AND_COL_IS_AFTER(A, B, C, D) \ |
59 | #define ROW_AND_COL_IS_AFTER(A, B, C, D) \ |
58 | (((A) > (C)) || (((A) == (C)) && ((B) > (D)))) |
60 | (((A) > (C)) || (((A) == (C)) && ((B) > (D)))) |
59 | #define ROW_AND_COL_IS_BEFORE(A, B, C, D) \ |
61 | #define ROW_AND_COL_IS_BEFORE(A, B, C, D) \ |
60 | (((A) < (C)) || (((A) == (C)) && ((B) < (D)))) |
62 | (((A) < (C)) || (((A) == (C)) && ((B) < (D)))) |
… | |
… | |
403 | tabs = (char *)rxvt_malloc (ncol); |
405 | tabs = (char *)rxvt_malloc (ncol); |
404 | |
406 | |
405 | for (int col = ncol; col--; ) |
407 | for (int col = ncol; col--; ) |
406 | tabs [col] = col % TABSIZE == 0; |
408 | tabs [col] = col % TABSIZE == 0; |
407 | |
409 | |
408 | CLEAR_SELECTION (); |
410 | CLEAR_ALL_SELECTION (); |
409 | CLEAR_SELECTION_MARK (); |
|
|
410 | |
411 | |
411 | prev_nrow = nrow; |
412 | prev_nrow = nrow; |
412 | prev_ncol = ncol; |
413 | prev_ncol = ncol; |
413 | |
414 | |
414 | tt_winch (); |
415 | tt_winch (); |
… | |
… | |
711 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
712 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
712 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
713 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
713 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
714 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
714 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
715 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
715 | { |
716 | { |
716 | CLEAR_SELECTION (); |
717 | CLEAR_ALL_SELECTION (); |
717 | if (!IN_RANGE_EXC (selection.mark.row, top_row, nrow)) |
718 | selection.op = SELECTION_CLEAR; |
718 | CLEAR_SELECTION_MARK (); |
|
|
719 | } |
719 | } |
720 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
720 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
721 | { |
721 | { |
722 | /* move selected region too */ |
722 | /* move selected region too */ |
723 | selection.beg.row -= count; |
723 | selection.beg.row -= count; |
… | |
… | |
2698 | |
2698 | |
2699 | row_col_t pos; |
2699 | row_col_t pos; |
2700 | pos.row = pos.col = 0; |
2700 | pos.row = pos.col = 0; |
2701 | |
2701 | |
2702 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2702 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
|
|
2703 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2703 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2704 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2704 | || (check_more == 1 |
2705 | || (check_more == 1 |
2705 | && current_screen == selection.screen |
2706 | && current_screen == selection.screen |
2706 | && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) |
2707 | && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) |
2707 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2708 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2708 | || (check_more == 2 |
2709 | || (check_more == 2 |
2709 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2710 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2710 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2711 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2711 | || (check_more == 3 |
2712 | || (check_more == 3 |
2712 | && ROWCOL_IS_AFTER (selection.end, pos))) |
2713 | && ROWCOL_IS_AFTER (selection.end, pos))) |
2713 | CLEAR_SELECTION (); |
2714 | CLEAR_ALL_SELECTION (); |
2714 | |
|
|
2715 | if (!IN_RANGE_EXC (selection.mark.row, top_row, nrow)) |
|
|
2716 | CLEAR_SELECTION_MARK (); |
|
|
2717 | } |
2715 | } |
2718 | |
2716 | |
2719 | /* ------------------------------------------------------------------------- */ |
2717 | /* ------------------------------------------------------------------------- */ |
2720 | /* |
2718 | /* |
2721 | * Paste a selection direct to the command fd |
2719 | * Paste a selection direct to the command fd |