… | |
… | |
688 | { |
688 | { |
689 | selection.beg.row -= count; |
689 | selection.beg.row -= count; |
690 | selection.end.row -= count; |
690 | selection.end.row -= count; |
691 | selection.mark.row -= count; |
691 | selection.mark.row -= count; |
692 | |
692 | |
693 | if (selection.beg.row < top_row |
693 | selection_check (0); |
694 | || selection.end.row < top_row |
|
|
695 | || selection.mark.row < top_row) |
|
|
696 | { |
|
|
697 | CLEAR_ALL_SELECTION (); |
|
|
698 | selection.op = SELECTION_CLEAR; |
|
|
699 | } |
|
|
700 | } |
694 | } |
701 | |
695 | |
702 | // finally move the view window, if desired |
696 | // finally move the view window, if desired |
703 | if (option (Opt_scrollWithBuffer) |
697 | if (option (Opt_scrollWithBuffer) |
704 | && view_start != 0 |
698 | && view_start != 0 |
… | |
… | |
2696 | * CHARACTER SELECTION * |
2690 | * CHARACTER SELECTION * |
2697 | * ------------------------------------------------------------------------- */ |
2691 | * ------------------------------------------------------------------------- */ |
2698 | void |
2692 | void |
2699 | rxvt_term::selection_check (int check_more) NOTHROW |
2693 | rxvt_term::selection_check (int check_more) NOTHROW |
2700 | { |
2694 | { |
2701 | row_col_t pos; |
|
|
2702 | |
|
|
2703 | if (!selection.op) |
2695 | if (!selection.op) |
2704 | return; |
2696 | return; |
2705 | |
2697 | |
|
|
2698 | row_col_t pos; |
2706 | pos.row = pos.col = 0; |
2699 | pos.row = pos.col = 0; |
|
|
2700 | |
2707 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2701 | if (!IN_RANGE_EXC (selection.beg.row, top_row, nrow) |
2708 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2702 | || !IN_RANGE_EXC (selection.mark.row, top_row, nrow) |
2709 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2703 | || !IN_RANGE_EXC (selection.end.row, top_row, nrow) |
2710 | || (check_more == 1 |
2704 | || (check_more == 1 |
2711 | && current_screen == selection.screen |
2705 | && current_screen == selection.screen |
… | |
… | |
2713 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2707 | && ROWCOL_IS_BEFORE (screen.cur, selection.end)) |
2714 | || (check_more == 2 |
2708 | || (check_more == 2 |
2715 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2709 | && ROWCOL_IS_BEFORE (selection.beg, pos) |
2716 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2710 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2717 | || (check_more == 3 |
2711 | || (check_more == 3 |
2718 | && ROWCOL_IS_AFTER (selection.end, pos)) |
2712 | && ROWCOL_IS_AFTER (selection.end, pos))) |
2719 | || (check_more == 4 /* screen width change */ |
|
|
2720 | && (selection.beg.row != selection.end.row |
|
|
2721 | || selection.end.col > ncol))) |
|
|
2722 | CLEAR_SELECTION (); |
2713 | CLEAR_ALL_SELECTION (); |
2723 | } |
2714 | } |
2724 | |
2715 | |
2725 | /* ------------------------------------------------------------------------- */ |
2716 | /* ------------------------------------------------------------------------- */ |
2726 | /* |
2717 | /* |
2727 | * Paste a selection direct to the command fd |
2718 | * Paste a selection direct to the command fd |