… | |
… | |
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); |
… | |
… | |
693 | if (len <= 0) /* sanity */ |
693 | if (len <= 0) /* sanity */ |
694 | return; |
694 | return; |
695 | |
695 | |
696 | unsigned char checksel; |
696 | unsigned char checksel; |
697 | unicode_t c; |
697 | unicode_t c; |
698 | int row, last_col; |
698 | int last_col; |
699 | const unicode_t *strend = str + len; |
699 | const unicode_t *strend = str + len; |
700 | |
700 | |
701 | want_refresh = 1; |
701 | want_refresh = 1; |
702 | ZERO_SCROLLBACK (); |
702 | ZERO_SCROLLBACK (); |
703 | last_col = ncol; |
703 | last_col = ncol; |
… | |
… | |
718 | #ifdef DEBUG_STRICT |
718 | #ifdef DEBUG_STRICT |
719 | assert (screen.cur.col < last_col); |
719 | assert (screen.cur.col < last_col); |
720 | assert (screen.cur.row < nrow |
720 | assert (screen.cur.row < nrow |
721 | && screen.cur.row >= -nsaved); |
721 | && screen.cur.row >= -nsaved); |
722 | #endif |
722 | #endif |
723 | row = screen.cur.row; |
723 | int row = screen.cur.row; |
724 | |
724 | |
725 | checksel = selection.op && current_screen == selection.screen ? 1 : 0; |
725 | checksel = selection.op && current_screen == selection.screen ? 1 : 0; |
726 | |
726 | |
727 | line_t *line = &ROW(row); |
727 | line_t *line = &ROW(row); |
728 | |
728 | |
… | |
… | |
985 | |
985 | |
986 | if (count == 0) |
986 | if (count == 0) |
987 | return; |
987 | return; |
988 | else if (count > 0) |
988 | else if (count > 0) |
989 | { |
989 | { |
990 | int row = screen.cur.row; |
|
|
991 | |
|
|
992 | line_t &l = ROW(row); |
990 | line_t &l = ROW(screen.cur.row); |
993 | rend_t base_rend = l.r[i]; |
991 | rend_t base_rend = l.r[i]; |
994 | ht &= l.t[i] == ' '; |
992 | ht &= l.t[i] == ' '; |
995 | |
993 | |
996 | for (; ++i < ncol; ) |
994 | for (; ++i < ncol; ) |
997 | if (tabs[i]) |
995 | if (tabs[i]) |
… | |
… | |
1072 | */ |
1070 | */ |
1073 | #if ENABLE_FRILLS |
1071 | #if ENABLE_FRILLS |
1074 | void |
1072 | void |
1075 | rxvt_term::scr_forwardindex () |
1073 | rxvt_term::scr_forwardindex () |
1076 | { |
1074 | { |
1077 | int row; |
|
|
1078 | |
|
|
1079 | if (screen.cur.col < ncol - 1) |
1075 | if (screen.cur.col < ncol - 1) |
1080 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1076 | scr_gotorc (0, 1, R_RELATIVE | C_RELATIVE); |
1081 | else |
1077 | else |
1082 | { |
1078 | { |
1083 | row = screen.cur.row; |
|
|
1084 | |
|
|
1085 | if (ROW(row).is_longer ()) //TODO//FIXME//LEN |
1079 | if (ROW(screen.cur.row).is_longer ()) //TODO//FIXME//LEN |
1086 | ROW(row).l = ncol; |
1080 | ROW(screen.cur.row).l = ncol; |
1087 | |
1081 | |
1088 | scr_gotorc (0, 0, R_RELATIVE); |
1082 | scr_gotorc (0, 0, R_RELATIVE); |
1089 | scr_insdel_chars (1, DELETE); |
1083 | scr_insdel_chars (1, DELETE); |
1090 | scr_gotorc (0, ncol - 1, R_RELATIVE); |
1084 | scr_gotorc (0, ncol - 1, R_RELATIVE); |
1091 | } |
1085 | } |
… | |
… | |
1174 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
1168 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
1175 | */ |
1169 | */ |
1176 | void |
1170 | void |
1177 | rxvt_term::scr_erase_line (int mode) |
1171 | rxvt_term::scr_erase_line (int mode) |
1178 | { |
1172 | { |
1179 | unsigned int row, col, num; |
1173 | unsigned int col, num; |
1180 | |
1174 | |
1181 | want_refresh = 1; |
1175 | want_refresh = 1; |
1182 | ZERO_SCROLLBACK (); |
1176 | ZERO_SCROLLBACK (); |
1183 | |
1177 | |
1184 | selection_check (1); |
1178 | selection_check (1); |
1185 | |
1179 | |
1186 | row = screen.cur.row; |
1180 | line_t &line = ROW(screen.cur.row); |
1187 | |
1181 | |
1188 | switch (mode) |
1182 | switch (mode) |
1189 | { |
1183 | { |
1190 | case 0: /* erase to end of line */ |
1184 | case 0: /* erase to end of line */ |
1191 | col = screen.cur.col; |
1185 | col = screen.cur.col; |
1192 | num = ncol - col; |
1186 | num = ncol - col; |
1193 | min_it (ROW(row).l, col); |
1187 | min_it (line.l, col); |
1194 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1188 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1195 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1189 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1196 | CLEAR_SELECTION (); |
1190 | CLEAR_SELECTION (); |
1197 | break; |
1191 | break; |
1198 | case 1: /* erase to beginning of line */ |
1192 | case 1: /* erase to beginning of line */ |
… | |
… | |
1203 | CLEAR_SELECTION (); |
1197 | CLEAR_SELECTION (); |
1204 | break; |
1198 | break; |
1205 | case 2: /* erase whole line */ |
1199 | case 2: /* erase whole line */ |
1206 | col = 0; |
1200 | col = 0; |
1207 | num = ncol; |
1201 | num = ncol; |
1208 | ROW(row).l = 0; |
1202 | line.l = 0; |
1209 | if (selection.beg.row <= screen.cur.row |
1203 | if (selection.beg.row <= screen.cur.row |
1210 | && selection.end.row >= screen.cur.row) |
1204 | && selection.end.row >= screen.cur.row) |
1211 | CLEAR_SELECTION (); |
1205 | CLEAR_SELECTION (); |
1212 | break; |
1206 | break; |
1213 | default: |
1207 | default: |
1214 | return; |
1208 | return; |
1215 | } |
1209 | } |
1216 | |
1210 | |
1217 | scr_blank_line (ROW(row), col, num, rstyle); |
1211 | scr_blank_line (line, col, num, rstyle); |
1218 | } |
1212 | } |
1219 | |
1213 | |
1220 | /* ------------------------------------------------------------------------- */ |
1214 | /* ------------------------------------------------------------------------- */ |
1221 | /* |
1215 | /* |
1222 | * Erase part of whole of the screen |
1216 | * Erase part of whole of the screen |