X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=terminal.c;h=2b3ae792c1e5c8ac358c5d399adb3d9f9c2d7107;hb=refs%2Fheads%2Fbranch-0.56;hp=7b56e619413635c3576a83cc9e2d2afcdee0bd04;hpb=b287bd560619987d94775682b65480cf8729d7e1;p=PuTTY.git diff --git a/terminal.c b/terminal.c index 7b56e619..2b3ae792 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; + } } } @@ -1596,8 +1599,11 @@ void term_out(Terminal *term) term->curs.x--; term->wrapnext = FALSE; fix_cpos; - if (!term->cfg.no_dbackspace) /* destructive bksp might be disabled */ + if (!term->cfg.no_dbackspace) { /* destructive bksp might be disabled */ + check_boundary(term, term->curs.x, term->curs.y); + check_boundary(term, term->curs.x+1, term->curs.y); *term->cpos = (' ' | term->curr_attr | ATTR_ASCII); + } } else /* Or normal C0 controls. */ if ((c & -32) == 0 && term->termstate < DO_CTRLS) { @@ -1697,7 +1703,7 @@ void term_out(Terminal *term) term_update(term); } } - term->disptop = 0; + term->seen_disp_event = TRUE; } break; case '\b': /* BS: Back space */ @@ -3281,6 +3287,7 @@ void term_out(Terminal *term) } term_print_flush(term); + logflush(term->logctx); } #if 0 @@ -3429,8 +3436,9 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise) } tattr |= (tchar & CSET_MASK); tchar &= CHAR_MASK; - if ((d[1] & (CHAR_MASK | CSET_MASK)) == UCSWIDE) - tattr |= ATTR_WIDE; + if (j < term->cols-1 && + (d[1] & (CHAR_MASK | CSET_MASK)) == UCSWIDE) + tattr |= ATTR_WIDE; /* Video reversing things */ if (term->selstate == DRAGGING || term->selstate == SELECTED) { @@ -3796,9 +3804,13 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect, int desel) void term_copyall(Terminal *term) { pos top; + pos bottom; + tree234 *screen = term->screen; top.y = -sblines(term); top.x = 0; - clipme(term, top, term->curs, 0, TRUE); + bottom.y = find_last_nonempty_line(term, screen); + bottom.x = term->cols; + clipme(term, top, bottom, 0, TRUE); } /* @@ -4792,8 +4804,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) {