aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@djpohly.com>2010-10-25 16:45:13 -0400
committerDevin J. Pohly <djpohly@djpohly.com>2010-10-25 16:45:13 -0400
commitea4d528fb9b148ba63bc5034d649c11110fd71a1 (patch)
treef4211f187a7ebfc42d0d0dbb4c31301a11facb81 /st.c
parent221a683ef22d660196c6f361358852589c7c7c8f (diff)
downloadst-ea4d528fb9b148ba63bc5034d649c11110fd71a1.tar.gz
st-ea4d528fb9b148ba63bc5034d649c11110fd71a1.tar.bz2
redraw if we scroll on resize
Diffstat (limited to 'st.c')
-rw-r--r--st.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/st.c b/st.c
index 1089087..ed8e2a8 100644
--- a/st.c
+++ b/st.c
@@ -170,7 +170,7 @@ static void tputtab(void);
static void tputc(char);
static void tputs(char*, int);
static void treset(void);
-static void tresize(int, int);
+static int tresize(int, int);
static void tscrollup(int, int);
static void tscrolldown(int, int);
static void tsetattr(int*, int);
@@ -1202,7 +1202,7 @@ tputs(char *s, int len) {
tputc(*s++);
}
-void
+int
tresize(int col, int row) {
int i, x;
int minrow = MIN(row, term.row);
@@ -1210,7 +1210,7 @@ tresize(int col, int row) {
int slide = term.c.y - row + 1;
if(col < 1 || row < 1)
- return;
+ return 0;
/* free unneeded rows */
i = 0;
@@ -1256,6 +1256,7 @@ tresize(int col, int row) {
tmoveto(term.c.x, term.c.y);
/* reset scrolling region */
tsetscroll(0, row-1);
+ return (slide > 0);
}
void
@@ -1650,7 +1651,8 @@ resize(XEvent *e) {
row = (xw.h - 2*BORDER) / xw.ch;
if(col == term.col && row == term.row)
return;
- tresize(col, row);
+ if(tresize(col, row))
+ draw(SCREEN_REDRAW);
ttyresize(col, row);
xresize(col, row);
}