… | |
… | |
1225 | /* |
1225 | /* |
1226 | * Erase part or whole of a line |
1226 | * Erase part or whole of a line |
1227 | * XTERM_SEQ: Clear line to right: ESC [ 0 K |
1227 | * XTERM_SEQ: Clear line to right: ESC [ 0 K |
1228 | * XTERM_SEQ: Clear line to left : ESC [ 1 K |
1228 | * XTERM_SEQ: Clear line to left : ESC [ 1 K |
1229 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
1229 | * XTERM_SEQ: Clear whole line : ESC [ 2 K |
|
|
1230 | * extension: clear to right unless wrapped: ESC [ 3 K |
1230 | */ |
1231 | */ |
1231 | void |
1232 | void |
1232 | rxvt_term::scr_erase_line (int mode) NOTHROW |
1233 | rxvt_term::scr_erase_line (int mode) NOTHROW |
1233 | { |
1234 | { |
1234 | unsigned int col, num; |
1235 | unsigned int col, num; |
… | |
… | |
1243 | line.touch (); |
1244 | line.touch (); |
1244 | line.is_longer (0); |
1245 | line.is_longer (0); |
1245 | |
1246 | |
1246 | switch (mode) |
1247 | switch (mode) |
1247 | { |
1248 | { |
|
|
1249 | case 3: |
|
|
1250 | if (screen.flags & Screen_WrapNext) |
|
|
1251 | return; |
|
|
1252 | |
|
|
1253 | /* fall through */ |
|
|
1254 | |
1248 | case 0: /* erase to end of line */ |
1255 | case 0: /* erase to end of line */ |
1249 | col = screen.cur.col; |
1256 | col = screen.cur.col; |
1250 | num = ncol - col; |
1257 | num = ncol - col; |
1251 | min_it (line.l, col); |
1258 | min_it (line.l, col); |
|
|
1259 | |
1252 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1260 | if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) |
1253 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1261 | || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) |
1254 | CLEAR_SELECTION (); |
1262 | CLEAR_SELECTION (); |
1255 | break; |
1263 | break; |
|
|
1264 | |
1256 | case 1: /* erase to beginning of line */ |
1265 | case 1: /* erase to beginning of line */ |
1257 | col = 0; |
1266 | col = 0; |
1258 | num = screen.cur.col + 1; |
1267 | num = screen.cur.col + 1; |
|
|
1268 | |
1259 | if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur) |
1269 | if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur) |
1260 | || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur)) |
1270 | || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur)) |
1261 | CLEAR_SELECTION (); |
1271 | CLEAR_SELECTION (); |
1262 | break; |
1272 | break; |
|
|
1273 | |
1263 | case 2: /* erase whole line */ |
1274 | case 2: /* erase whole line */ |
1264 | col = 0; |
1275 | col = 0; |
1265 | num = ncol; |
1276 | num = ncol; |
1266 | line.l = 0; |
1277 | line.l = 0; |
1267 | if (selection.beg.row <= screen.cur.row |
1278 | if (selection.beg.row <= screen.cur.row |