vt: on resize, restore screen using history buffer

This commit is contained in:
cinap_lenrek 2012-11-10 07:56:39 +01:00
parent 0ad8548b70
commit 00daf47137

View file

@ -579,6 +579,8 @@ resize(void)
olines = 0; olines = 0;
exportsize(); exportsize();
clear(screen->r); clear(screen->r);
if(resize_flag > 1)
backup(backc);
resize_flag = 0; resize_flag = 0;
werrstr(""); /* clear spurious error messages */ werrstr(""); /* clear spurious error messages */
} }
@ -684,7 +686,13 @@ backup(int count)
register char *cp; register char *cp;
eresized(0); eresized(0);
n = 3*(count+1)*ymax/4; if(count == 0 && !pagemode) {
n = ymax;
nbacklines = HISTSIZ; /* make sure we scroll to the very end */
} else{
n = 3*(count+1)*ymax/4;
nbacklines = ymax-1;
}
cp = histp; cp = histp;
atend = 0; atend = 0;
while (n >= 0) { while (n >= 0) {
@ -702,7 +710,6 @@ backup(int count)
if(cp >= &hist[HISTSIZ]) if(cp >= &hist[HISTSIZ])
cp = hist; cp = hist;
backp = cp; backp = cp;
nbacklines = ymax-2;
} }
Point Point