summaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--st.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/st.c b/st.c
index 586d124..b143582 100644
--- a/st.c
+++ b/st.c
@@ -221,6 +221,7 @@ typedef struct {
221 struct {int x, y;} b, e; 221 struct {int x, y;} b, e;
222 char *clip; 222 char *clip;
223 Atom xtarget; 223 Atom xtarget;
224 bool alt;
224 struct timeval tclick1; 225 struct timeval tclick1;
225 struct timeval tclick2; 226 struct timeval tclick2;
226} Selection; 227} Selection;
@@ -579,6 +580,7 @@ selcopy(void) {
579 } 580 }
580 *ptr = 0; 581 *ptr = 0;
581 } 582 }
583 sel.alt = IS_SET(MODE_ALTSCREEN);
582 xsetsel(str); 584 xsetsel(str);
583} 585}
584 586
@@ -2076,7 +2078,10 @@ drawregion(int x1, int y1, int x2, int y2) {
2076 int ic, ib, x, y, ox, sl; 2078 int ic, ib, x, y, ox, sl;
2077 Glyph base, new; 2079 Glyph base, new;
2078 char buf[DRAW_BUF_SIZ]; 2080 char buf[DRAW_BUF_SIZ];
2081 bool ena_sel = sel.bx != -1, alt = IS_SET(MODE_ALTSCREEN);
2079 2082
2083 if((sel.alt && !alt) || (!sel.alt && alt))
2084 ena_sel = 0;
2080 if(!(xw.state & WIN_VISIBLE)) 2085 if(!(xw.state & WIN_VISIBLE))
2081 return; 2086 return;
2082 2087
@@ -2089,7 +2094,7 @@ drawregion(int x1, int y1, int x2, int y2) {
2089 ic = ib = ox = 0; 2094 ic = ib = ox = 0;
2090 for(x = x1; x < x2; x++) { 2095 for(x = x1; x < x2; x++) {
2091 new = term.line[y][x]; 2096 new = term.line[y][x];
2092 if(sel.bx != -1 && *(new.c) && selected(x, y)) 2097 if(ena_sel && *(new.c) && selected(x, y))
2093 new.mode ^= ATTR_REVERSE; 2098 new.mode ^= ATTR_REVERSE;
2094 if(ib > 0 && (!(new.state & GLYPH_SET) || ATTRCMP(base, new) || 2099 if(ib > 0 && (!(new.state & GLYPH_SET) || ATTRCMP(base, new) ||
2095 ib >= DRAW_BUF_SIZ-UTF_SIZ)) { 2100 ib >= DRAW_BUF_SIZ-UTF_SIZ)) {