… | |
… | |
143 | col--; |
143 | col--; |
144 | |
144 | |
145 | rend_t rend = l.r[col] & ~RS_baseattrMask; |
145 | rend_t rend = l.r[col] & ~RS_baseattrMask; |
146 | rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); |
146 | rend = SET_FONT (rend, FONTSET (rend)->find_font (' ')); |
147 | |
147 | |
148 | // found begin, nuke |
148 | // found start, nuke |
149 | do { |
149 | do { |
150 | l.t[col] = ' '; |
150 | l.t[col] = ' '; |
151 | l.r[col] = rend; |
151 | l.r[col] = rend; |
152 | col++; |
152 | col++; |
153 | } while (col < ncol && l.t[col] == NOCHAR); |
153 | } while (col < ncol && l.t[col] == NOCHAR); |
… | |
… | |
1464 | line_t *line = &ROW(row); |
1464 | line_t *line = &ROW(row); |
1465 | |
1465 | |
1466 | line->touch (); |
1466 | line->touch (); |
1467 | line->is_longer (0); |
1467 | line->is_longer (0); |
1468 | |
1468 | |
|
|
1469 | // nuke wide spanning the start |
|
|
1470 | if (line->t[screen.cur.col] == NOCHAR) |
|
|
1471 | scr_kill_char (*line, screen.cur.col); |
|
|
1472 | |
1469 | switch (insdel) |
1473 | switch (insdel) |
1470 | { |
1474 | { |
1471 | case INSERT: |
1475 | case INSERT: |
1472 | line->l = min (line->l + count, ncol); |
1476 | line->l = min (line->l + count, ncol); |
|
|
1477 | |
|
|
1478 | if (line->t[screen.cur.col] == NOCHAR) |
|
|
1479 | scr_kill_char (*line, screen.cur.col); |
1473 | |
1480 | |
1474 | for (int col = ncol - 1; (col - count) >= screen.cur.col; col--) |
1481 | for (int col = ncol - 1; (col - count) >= screen.cur.col; col--) |
1475 | { |
1482 | { |
1476 | line->t[col] = line->t[col - count]; |
1483 | line->t[col] = line->t[col - count]; |
1477 | line->r[col] = line->r[col - count]; |
1484 | line->r[col] = line->r[col - count]; |
… | |
… | |
1498 | case ERASE: |
1505 | case ERASE: |
1499 | screen.cur.col += count; /* don't worry if > ncol */ |
1506 | screen.cur.col += count; /* don't worry if > ncol */ |
1500 | selection_check (1); |
1507 | selection_check (1); |
1501 | screen.cur.col -= count; |
1508 | screen.cur.col -= count; |
1502 | |
1509 | |
|
|
1510 | // nuke wide char after the end |
|
|
1511 | if (screen.cur.col + count < ncol && line->t[screen.cur.col + count] == NOCHAR) |
|
|
1512 | scr_kill_char (*line, screen.cur.col + count); |
|
|
1513 | |
1503 | scr_blank_line (*line, screen.cur.col, count, rstyle); |
1514 | scr_blank_line (*line, screen.cur.col, count, rstyle); |
1504 | break; |
1515 | break; |
1505 | |
1516 | |
1506 | case DELETE: |
1517 | case DELETE: |
1507 | { |
|
|
1508 | line->l = max (line->l - count, 0); |
1518 | line->l = max (line->l - count, 0); |
1509 | |
1519 | |
1510 | rend_t tr = line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask); |
1520 | // nuke wide char spanning the end |
|
|
1521 | if (screen.cur.col + count < ncol && line->t[screen.cur.col + count] == NOCHAR) |
|
|
1522 | scr_kill_char (*line, screen.cur.col + count); |
1511 | |
1523 | |
1512 | for (int col = screen.cur.col; (col + count) < ncol; col++) |
1524 | for (int col = screen.cur.col; (col + count) < ncol; col++) |
1513 | { |
1525 | { |
1514 | line->t[col] = line->t[col + count]; |
1526 | line->t[col] = line->t[col + count]; |
1515 | line->r[col] = line->r[col + count]; |
1527 | line->r[col] = line->r[col + count]; |
1516 | } |
1528 | } |
1517 | |
1529 | |
1518 | // nuke wide char at the end |
|
|
1519 | if (line->t[screen.cur.col] == NOCHAR) |
|
|
1520 | scr_kill_char (*line, screen.cur.col); |
|
|
1521 | |
|
|
1522 | scr_blank_line (*line, ncol - count, count, tr); |
1530 | scr_blank_line (*line, ncol - count, count, |
|
|
1531 | line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask)); |
1523 | |
1532 | |
1524 | if (selection.op && current_screen == selection.screen |
1533 | if (selection.op && current_screen == selection.screen |
1525 | && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)) |
1534 | && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)) |
1526 | { |
1535 | { |
1527 | if (selection.end.row != screen.cur.row |
1536 | if (selection.end.row != screen.cur.row |
1528 | || (screen.cur.col >= selection.beg.col - count) |
1537 | || (screen.cur.col >= selection.beg.col - count) |
1529 | || selection.end.col >= ncol) |
1538 | || selection.end.col >= ncol) |
1530 | CLEAR_SELECTION (); |
1539 | CLEAR_SELECTION (); |
1531 | else |
1540 | else |
1532 | { |
1541 | { |
1533 | /* shift selection */ |
1542 | /* shift selection */ |
1534 | selection.beg.col -= count; |
1543 | selection.beg.col -= count; |
1535 | selection.mark.col -= count; /* XXX: yes? */ |
1544 | selection.mark.col -= count; /* XXX: yes? */ |
1536 | selection.end.col -= count; |
1545 | selection.end.col -= count; |
1537 | } |
1546 | } |
1538 | } |
|
|
1539 | } |
1547 | } |
1540 | |
1548 | |
1541 | break; |
1549 | break; |
1542 | } |
1550 | } |
1543 | } |
1551 | } |