… | |
… | |
681 | } |
681 | } |
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 |
|
|
687 | if (selection.op && current_screen == selection.screen) |
|
|
688 | { |
|
|
689 | selection.beg.row -= count; |
|
|
690 | selection.end.row -= count; |
|
|
691 | selection.mark.row -= count; |
|
|
692 | |
|
|
693 | selection_check (0); |
|
|
694 | } |
|
|
695 | |
|
|
696 | // finally move the view window, if desired |
686 | // finally move the view window, if desired |
697 | if (option (Opt_scrollWithBuffer) |
687 | if (option (Opt_scrollWithBuffer) |
698 | && view_start != 0 |
688 | && view_start != 0 |
699 | && view_start != -saveLines) |
689 | && view_start != -saveLines) |
700 | scr_page (UP, count); |
690 | scr_page (UP, count); |
… | |
… | |
702 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
692 | if (SHOULD_INVOKE (HOOK_SCROLL_BACK)) |
703 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
693 | HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, top_row, DT_END)); |
704 | } |
694 | } |
705 | else |
695 | else |
706 | { |
696 | { |
707 | if (selection.op && current_screen == selection.screen) |
|
|
708 | { |
|
|
709 | if ((selection.beg.row < row1 && selection.end.row > row1) |
|
|
710 | || (selection.beg.row < row2 && selection.end.row > row2) |
|
|
711 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
|
|
712 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
|
|
713 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
|
|
714 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
|
|
715 | { |
|
|
716 | CLEAR_ALL_SELECTION (); |
|
|
717 | selection.op = SELECTION_CLEAR; |
|
|
718 | } |
|
|
719 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
|
|
720 | { |
|
|
721 | /* move selected region too */ |
|
|
722 | selection.beg.row -= count; |
|
|
723 | selection.end.row -= count; |
|
|
724 | selection.mark.row -= count; |
|
|
725 | |
|
|
726 | selection_check (0); |
|
|
727 | } |
|
|
728 | } |
|
|
729 | |
|
|
730 | // use a simple and robust scrolling algorithm, this |
697 | // use a simple and robust scrolling algorithm, this |
731 | // part of scr_scroll_text is not time-critical. |
698 | // part of scr_scroll_text is not time-critical. |
732 | |
699 | |
733 | // sever line above scroll region |
700 | // sever line above scroll region |
734 | if (row1) |
701 | if (row1) |
… | |
… | |
759 | { |
726 | { |
760 | line_t &l = ROW(row2); |
727 | line_t &l = ROW(row2); |
761 | l.is_longer (0); |
728 | l.is_longer (0); |
762 | l.touch (); |
729 | l.touch (); |
763 | } |
730 | } |
|
|
731 | } |
|
|
732 | |
|
|
733 | // move and/or clear selection, if any |
|
|
734 | if (selection.op && current_screen == selection.screen) |
|
|
735 | { |
|
|
736 | if ((selection.beg.row < row1 && selection.end.row > row1) |
|
|
737 | || (selection.beg.row < row2 && selection.end.row > row2) |
|
|
738 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
|
|
739 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
|
|
740 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
|
|
741 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
|
|
742 | CLEAR_ALL_SELECTION (); |
|
|
743 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
|
|
744 | { |
|
|
745 | /* move selected region too */ |
|
|
746 | selection.beg.row -= count; |
|
|
747 | selection.end.row -= count; |
|
|
748 | selection.mark.row -= count; |
|
|
749 | |
|
|
750 | selection_check (0); |
|
|
751 | } |
764 | } |
752 | } |
765 | |
753 | |
766 | return count; |
754 | return count; |
767 | } |
755 | } |
768 | |
756 | |