X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/24abf4f161576c23cea45b0a6ff790f2e59ad754..83a421a5ec7770524c57f45bef3dcacb9dd9bfff:/terminal.c diff --git a/terminal.c b/terminal.c index 079a738a..3a2ab620 100644 --- a/terminal.c +++ b/terminal.c @@ -1614,6 +1614,8 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines) addpos234(term->screen, line, 0); term->curs.y += 1; term->savecurs.y += 1; + term->alt_y += 1; + term->alt_savecurs.y += 1; } else { /* Add a new blank line at the bottom of the screen. */ line = newline(term, newcols, FALSE); @@ -1634,6 +1636,8 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines) term->tempsblines += 1; term->curs.y -= 1; term->savecurs.y -= 1; + term->alt_y -= 1; + term->alt_savecurs.y -= 1; } term->rows -= 1; } @@ -1693,12 +1697,26 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines) term->savecurs.y = 0; if (term->savecurs.y >= newrows) term->savecurs.y = newrows - 1; + if (term->savecurs.x >= newcols) + term->savecurs.x = newcols - 1; + if (term->alt_savecurs.y < 0) + term->alt_savecurs.y = 0; + if (term->alt_savecurs.y >= newrows) + term->alt_savecurs.y = newrows - 1; + if (term->alt_savecurs.x >= newcols) + term->alt_savecurs.x = newcols - 1; if (term->curs.y < 0) term->curs.y = 0; if (term->curs.y >= newrows) term->curs.y = newrows - 1; if (term->curs.x >= newcols) term->curs.x = newcols - 1; + if (term->alt_y < 0) + term->alt_y = 0; + if (term->alt_y >= newrows) + term->alt_y = newrows - 1; + if (term->alt_x >= newcols) + term->alt_x = newcols - 1; term->alt_x = term->alt_y = 0; term->wrapnext = term->alt_wnext = FALSE;