aboutsummarylogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero2013-04-23 20:34:52 +0200
committerChristoph Lohmann2013-04-23 20:36:30 +0200
commit0be752d2769ff212795ed4cb46581b254eed332d (patch)
tree4a64eaaf2ce948e8b14e73b6e508c341dccf52fe /st.c
parentda0256301447221a5c576d21f587cf000764802d (diff)
downloadaur-0be752d2769ff212795ed4cb46581b254eed332d.tar.gz
Fix selecting clearing and BCE
The commit b78c5085f72 changed the st behaviour enabling BCE capability, that means erase regions using background color. Problem comes when you clear a region with a selection, because in this case the real mode of the Glyph is not the value of term.line[y][x], due in drawregion we had enabled the ATTR_REVERSE bit. Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'st.c')
-rw-r--r--st.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/st.c b/st.c
index 7f53981f80cb..92854b4a3bac 100644
--- a/st.c
+++ b/st.c
@@ -1410,7 +1410,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) {
void
tclearregion(int x1, int y1, int x2, int y2) {
- int x, y, temp;
+ int x, y, temp, mask;
if(x1 > x2)
temp = x1, x1 = x2, x2 = temp;
@@ -1425,7 +1425,9 @@ tclearregion(int x1, int y1, int x2, int y2) {
for(y = y1; y <= y2; y++) {
term.dirty[y] = 1;
for(x = x1; x <= x2; x++) {
+ mask = selected(x, y) ? ATTR_REVERSE : 0;
term.line[y][x] = term.c.attr;
+ term.line[y][x].mode ^= mask;
memcpy(term.line[y][x].c, " ", 2);
}
}