aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--st.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/st.c b/st.c
index 45bc89d..e0aae9d 100644
--- a/st.c
+++ b/st.c
@@ -1553,6 +1553,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) {
1553void 1553void
1554tclearregion(int x1, int y1, int x2, int y2) { 1554tclearregion(int x1, int y1, int x2, int y2) {
1555 int x, y, temp; 1555 int x, y, temp;
1556 Glyph *gp;
1556 1557
1557 if(x1 > x2) 1558 if(x1 > x2)
1558 temp = x1, x1 = x2, x2 = temp; 1559 temp = x1, x1 = x2, x2 = temp;
@@ -1567,10 +1568,13 @@ tclearregion(int x1, int y1, int x2, int y2) {
1567 for(y = y1; y <= y2; y++) { 1568 for(y = y1; y <= y2; y++) {
1568 term.dirty[y] = 1; 1569 term.dirty[y] = 1;
1569 for(x = x1; x <= x2; x++) { 1570 for(x = x1; x <= x2; x++) {
1571 gp = &term.line[y][x];
1570 if(selected(x, y)) 1572 if(selected(x, y))
1571 selclear(NULL); 1573 selclear(NULL);
1572 term.line[y][x] = term.c.attr; 1574 gp->fg = term.c.attr.fg;
1573 memcpy(term.line[y][x].c, " ", 2); 1575 gp->bg = term.c.attr.bg;
1576 gp->mode = 0;
1577 memcpy(gp->c, " ", 2);
1574 } 1578 }
1575 } 1579 }
1576} 1580}