diff options
-rw-r--r-- | st.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1587,30 +1587,32 @@ tclearregion(int x1, int y1, int x2, int y2) { | |||
1587 | void | 1587 | void |
1588 | tdeletechar(int n) { | 1588 | tdeletechar(int n) { |
1589 | int dst, src, size; | 1589 | int dst, src, size; |
1590 | Glyph *line; | ||
1590 | 1591 | ||
1591 | LIMIT(n, 0, term.col - term.c.x); | 1592 | LIMIT(n, 0, term.col - term.c.x); |
1592 | 1593 | ||
1593 | dst = term.c.x; | 1594 | dst = term.c.x; |
1594 | src = term.c.x + n; | 1595 | src = term.c.x + n; |
1595 | size = term.col - src; | 1596 | size = term.col - src; |
1597 | line = term.line[term.c.y]; | ||
1596 | 1598 | ||
1597 | memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], | 1599 | memmove(&line[dst], &line[src], size * sizeof(Glyph)); |
1598 | size * sizeof(Glyph)); | ||
1599 | tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); | 1600 | tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); |
1600 | } | 1601 | } |
1601 | 1602 | ||
1602 | void | 1603 | void |
1603 | tinsertblank(int n) { | 1604 | tinsertblank(int n) { |
1604 | int dst, src, size; | 1605 | int dst, src, size; |
1606 | Glyph *line; | ||
1605 | 1607 | ||
1606 | LIMIT(n, 0, term.col - term.c.x); | 1608 | LIMIT(n, 0, term.col - term.c.x); |
1607 | 1609 | ||
1608 | dst = term.c.x + n; | 1610 | dst = term.c.x + n; |
1609 | src = term.c.x; | 1611 | src = term.c.x; |
1610 | size = term.col - dst; | 1612 | size = term.col - dst; |
1613 | line = term.line[term.c.y]; | ||
1611 | 1614 | ||
1612 | memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], | 1615 | memmove(&line[dst], &line[src], size * sizeof(Glyph)); |
1613 | size * sizeof(Glyph)); | ||
1614 | tclearregion(src, term.c.y, dst - 1, term.c.y); | 1616 | tclearregion(src, term.c.y, dst - 1, term.c.y); |
1615 | } | 1617 | } |
1616 | 1618 | ||