X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/69761fd51226e0a2582c933eafeca38d39a6c4fc..408478526e8140d94dce70528152c5709ff7d53d:/terminal.c diff --git a/terminal.c b/terminal.c index 7b56e619..cb00ea6e 100644 --- a/terminal.c +++ b/terminal.c @@ -850,26 +850,29 @@ static void scroll(Terminal *term, int topline, int botline, int lines, int sb) */ seltop = sb ? -term->savelines : topline; - if (term->selstart.y >= seltop && - term->selstart.y <= botline) { - term->selstart.y--; - if (term->selstart.y < seltop) { - term->selstart.y = seltop; - term->selstart.x = 0; + if (term->selstate != NO_SELECTION) { + if (term->selstart.y >= seltop && + term->selstart.y <= botline) { + term->selstart.y--; + if (term->selstart.y < seltop) { + term->selstart.y = seltop; + term->selstart.x = 0; + } } - } - if (term->selend.y >= seltop && term->selend.y <= botline) { - term->selend.y--; - if (term->selend.y < seltop) { - term->selend.y = seltop; - term->selend.x = 0; + if (term->selend.y >= seltop && term->selend.y <= botline) { + term->selend.y--; + if (term->selend.y < seltop) { + term->selend.y = seltop; + term->selend.x = 0; + } } - } - if (term->selanchor.y >= seltop && term->selanchor.y <= botline) { - term->selanchor.y--; - if (term->selanchor.y < seltop) { - term->selanchor.y = seltop; - term->selanchor.x = 0; + if (term->selanchor.y >= seltop && + term->selanchor.y <= botline) { + term->selanchor.y--; + if (term->selanchor.y < seltop) { + term->selanchor.y = seltop; + term->selanchor.x = 0; + } } } @@ -1697,7 +1700,7 @@ void term_out(Terminal *term) term_update(term); } } - term->disptop = 0; + term->seen_disp_event = TRUE; } break; case '\b': /* BS: Back space */ @@ -4792,8 +4795,6 @@ int term_ldisc(Terminal *term, int option) int term_data(Terminal *term, int is_stderr, const char *data, int len) { - assert(len > 0); - bufchain_add(&term->inbuf, data, len); if (!term->in_term_out) {