… | |
… | |
385 | } |
385 | } |
386 | |
386 | |
387 | term_start = 0; |
387 | term_start = 0; |
388 | } |
388 | } |
389 | |
389 | |
390 | #ifdef DEBUG_STRICT |
390 | #ifdef DEBUG_STRICT //TODO: remove |
391 | for (int i = -nsaved; i < nrow; i++) |
391 | for (int i = -nsaved; i < nrow; i++) |
392 | assert (ROW (i).t); |
392 | assert (ROW (i).t); |
393 | #endif |
393 | #endif |
394 | |
394 | |
395 | free (old_buf); |
395 | free (old_buf); |
… | |
… | |
620 | { |
620 | { |
621 | selection.beg.row -= count; |
621 | selection.beg.row -= count; |
622 | selection.end.row -= count; |
622 | selection.end.row -= count; |
623 | selection.mark.row -= count; |
623 | selection.mark.row -= count; |
624 | |
624 | |
625 | selection_check (0); |
625 | if (selection.beg.row < -nsaved |
|
|
626 | || selection.end.row < -nsaved |
|
|
627 | || selection.mark.row < -nsaved) |
|
|
628 | { |
|
|
629 | CLEAR_ALL_SELECTION (); |
|
|
630 | selection.op = SELECTION_CLEAR; |
|
|
631 | } |
626 | } |
632 | } |
627 | |
633 | |
628 | for (int i = count; i--; ) |
634 | for (int i = count; i--; ) |
629 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
635 | scr_blank_screen_mem (ROW(row2 - i), rstyle); |
630 | |
636 | |
… | |
… | |
635 | } |
641 | } |
636 | else |
642 | else |
637 | { |
643 | { |
638 | if (selection.op && current_screen == selection.screen) |
644 | if (selection.op && current_screen == selection.screen) |
639 | { |
645 | { |
640 | int i = selection.beg.row; |
646 | if ((selection.beg.row < row1 && selection.end.row > row1) |
641 | int j = selection.end.row; |
647 | || (selection.beg.row < row2 && selection.end.row > row2) |
642 | |
|
|
643 | if ((i < row1 && j > row1) |
|
|
644 | || (i < row2 && j > row2) |
|
|
645 | || (i - count < row1 && i >= row1) |
648 | || (selection.beg.row - count < row1 && selection.beg.row >= row1) |
646 | || (i - count > row2 && i <= row2) |
649 | || (selection.beg.row - count > row2 && selection.beg.row <= row2) |
647 | || (j - count < row1 && j >= row1) |
650 | || (selection.end.row - count < row1 && selection.end.row >= row1) |
648 | || (j - count > row2 && j <= row2)) |
651 | || (selection.end.row - count > row2 && selection.end.row <= row2)) |
649 | { |
652 | { |
650 | CLEAR_ALL_SELECTION (); |
653 | CLEAR_ALL_SELECTION (); |
651 | selection.op = SELECTION_CLEAR; /* XXX: too aggressive? */ |
654 | selection.op = SELECTION_CLEAR; |
652 | } |
655 | } |
653 | else if (j >= row1 && j <= row2) |
656 | else if (selection.end.row >= row1 && selection.end.row <= row2) |
654 | { |
657 | { |
655 | /* move selected region too */ |
658 | /* move selected region too */ |
656 | selection.beg.row -= count; |
659 | selection.beg.row -= count; |
657 | selection.end.row -= count; |
660 | selection.end.row -= count; |
658 | selection.mark.row -= count; |
661 | selection.mark.row -= count; |
… | |
… | |
693 | if (len <= 0) /* sanity */ |
696 | if (len <= 0) /* sanity */ |
694 | return; |
697 | return; |
695 | |
698 | |
696 | unsigned char checksel; |
699 | unsigned char checksel; |
697 | unicode_t c; |
700 | unicode_t c; |
698 | int row, last_col; |
701 | int last_col; |
699 | const unicode_t *strend = str + len; |
702 | const unicode_t *strend = str + len; |
700 | |
703 | |
701 | want_refresh = 1; |
704 | want_refresh = 1; |
702 | ZERO_SCROLLBACK (); |
705 | ZERO_SCROLLBACK (); |
703 | last_col = ncol; |
706 | last_col = ncol; |
… | |
… | |
718 | #ifdef DEBUG_STRICT |
721 | #ifdef DEBUG_STRICT |
719 | assert (screen.cur.col < last_col); |
722 | assert (screen.cur.col < last_col); |
720 | assert (screen.cur.row < nrow |
723 | assert (screen.cur.row < nrow |
721 | && screen.cur.row >= -nsaved); |
724 | && screen.cur.row >= -nsaved); |
722 | #endif |
725 | #endif |
723 | row = screen.cur.row; |
726 | int row = screen.cur.row; |
724 | |
727 | |
725 | checksel = selection.op && current_screen == selection.screen ? 1 : 0; |
728 | checksel = selection.op && current_screen == selection.screen ? 1 : 0; |
726 | |
729 | |
727 | line_t *line = &ROW(row); |
730 | line_t *line = &ROW(row); |
728 | |
731 | |
… | |
… | |
985 | |
988 | |
986 | if (count == 0) |
989 | if (count == 0) |
987 | return; |
990 | return; |
988 | else if (count > 0) |
991 | else if (count > 0) |
989 | { |
992 | { |
990 | int row = screen.cur.row; |
|
|
991 | |
|
|
992 | line_t &l = ROW(row); |
993 | line_t &l = ROW(screen.cur.row); |
993 | rend_t base_rend = l.r[i]; |
994 | rend_t base_rend = l.r[i]; |
994 | ht &= l.t[i] == ' '; |
995 | ht &= l.t[i] == ' '; |
995 | |
996 | |
996 | for (; ++i < ncol; ) |
997 | for (; ++i < ncol; ) |
997 | if (tabs[i]) |
998 | if (tabs[i]) |
… | |
… | |
1072 | */ |
1073 | */ |
1073 | #if ENABLE_FRILLS |
1074 | #if ENABLE_FRILLS |
1074 | void |
1075 | void |
1075 | rxvt_term::scr_forwardindex () |
1076 | rxvt_term::scr_forwardindex () |
1076 | { |
1077 | { |
1077 | int row; |
|
|
1078 | |
|
|
1079 | if (screen.cur.col < ncol - 1) |
1078 | if (screen.cur.col < ncol - 1) |
1080 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1079 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1081 | else |
1080 | else |
1082 | { |
1081 | { |
1083 | row = screen.cur.row; |
|
|
1084 | |
|
|
1085 | if (ROW(row).is_longer ()) //TODO//FIXME//LEN |
1082 | if (ROW(screen.cur.row).is_longer ()) //TODO//FIXME//LEN |
1086 | ROW(row).l = ncol; |
1083 | ROW(screen.cur.row).l = ncol; |
1087 | |
1084 | |
1088 | scr_gotorc (0, 0, R_RELATIVE); |
1085 | scr_gotorc (0, 0, R_RELATIVE); |
1089 | scr_insdel_chars (1, DELETE); |
1086 | scr_insdel_chars (1, DELETE); |
1090 | scr_gotorc (0, ncol - 1, R_RELATIVE); |
1087 | scr_gotorc (0, ncol - 1, R_RELATIVE); |
1091 | } |
1088 | } |
… | |
… | |
1174 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
1171 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
1175 | */ |
1172 | */ |
1176 | void |
1173 | void |
1177 | rxvt_term::scr_erase_line (int mode) |
1174 | rxvt_term::scr_erase_line (int mode) |
1178 | { |
1175 | { |
1179 | unsigned int row, col, num; |
1176 | unsigned int col, num; |
1180 | |
1177 | |
1181 | want_refresh = 1; |
1178 | want_refresh = 1; |
1182 | ZERO_SCROLLBACK (); |
1179 | ZERO_SCROLLBACK (); |
1183 | |
1180 | |
1184 | selection_check (1); |
1181 | selection_check (1); |
1185 | |
1182 | |
1186 | row = screen.cur.row; |
1183 | line_t &line = ROW(screen.cur.row); |
1187 | |
1184 | |
1188 | switch (mode) |
1185 | switch (mode) |
1189 | { |
1186 | { |
1190 | case 0: /* erase to end of line */ |
1187 | case 0: /* erase to end of line */ |
1191 | col = screen.cur.col; |
1188 | col = screen.cur.col; |
1192 | num = ncol - col; |
1189 | num = ncol - col; |
1193 | min_it (ROW(row).l, col); |
1190 | min_it (line.l, col); |
1194 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1191 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1195 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1192 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1196 | CLEAR_SELECTION (); |
1193 | CLEAR_SELECTION (); |
1197 | break; |
1194 | break; |
1198 | case 1: /* erase to beginning of line */ |
1195 | case 1: /* erase to beginning of line */ |
… | |
… | |
1203 | CLEAR_SELECTION (); |
1200 | CLEAR_SELECTION (); |
1204 | break; |
1201 | break; |
1205 | case 2: /* erase whole line */ |
1202 | case 2: /* erase whole line */ |
1206 | col = 0; |
1203 | col = 0; |
1207 | num = ncol; |
1204 | num = ncol; |
1208 | ROW(row).l = 0; |
1205 | line.l = 0; |
1209 | if (selection.beg.row <= screen.cur.row |
1206 | if (selection.beg.row <= screen.cur.row |
1210 | && selection.end.row >= screen.cur.row) |
1207 | && selection.end.row >= screen.cur.row) |
1211 | CLEAR_SELECTION (); |
1208 | CLEAR_SELECTION (); |
1212 | break; |
1209 | break; |
1213 | default: |
1210 | default: |
1214 | return; |
1211 | return; |
1215 | } |
1212 | } |
1216 | |
1213 | |
1217 | scr_blank_line (ROW(row), col, num, rstyle); |
1214 | scr_blank_line (line, col, num, rstyle); |
1218 | } |
1215 | } |
1219 | |
1216 | |
1220 | /* ------------------------------------------------------------------------- */ |
1217 | /* ------------------------------------------------------------------------- */ |
1221 | /* |
1218 | /* |
1222 | * Erase part of whole of the screen |
1219 | * Erase part of whole of the screen |