=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.33 retrieving revision 1.34 diff -c -r1.33 -r1.34 *** src/usr.bin/tmux/screen-write.c 2009/10/17 08:35:38 1.33 --- src/usr.bin/tmux/screen-write.c 2009/10/20 16:32:23 1.34 *************** *** 1,4 **** ! /* $OpenBSD: screen-write.c,v 1.33 2009/10/17 08:35:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen-write.c,v 1.34 2009/10/20 16:32:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 855,870 **** s->mode &= ~MODE_MOUSE; } ! /* ! * Line feed the screen only (don't update the tty). Used for printing single ! * characters, where might want to let the scroll happen naturally. ! */ void ! screen_write_linefeedscreen(struct screen_write_ctx *ctx, int wrapped) { struct screen *s = ctx->s; struct grid_line *gl; gl = &s->grid->linedata[s->grid->hsize + s->cy]; if (wrapped) gl->flags |= GRID_LINE_WRAPPED; --- 855,870 ---- s->mode &= ~MODE_MOUSE; } ! /* Line feed. */ void ! screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped) { struct screen *s = ctx->s; struct grid_line *gl; + struct tty_ctx ttyctx; + screen_write_initctx(ctx, &ttyctx, 0); + gl = &s->grid->linedata[s->grid->hsize + s->cy]; if (wrapped) gl->flags |= GRID_LINE_WRAPPED; *************** *** 875,892 **** grid_view_scroll_region_up(s->grid, s->rupper, s->rlower); else if (s->cy < screen_size_y(s) - 1) s->cy++; - } ! /* Line feed (down with scroll). */ ! void ! screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped) ! { ! struct tty_ctx ttyctx; ! ! screen_write_initctx(ctx, &ttyctx, 0); ! ! screen_write_linefeedscreen(ctx, wrapped); ! tty_write(tty_cmd_linefeed, &ttyctx); } --- 875,882 ---- grid_view_scroll_region_up(s->grid, s->rupper, s->rlower); else if (s->cy < screen_size_y(s) - 1) s->cy++; ! ttyctx.num = wrapped; tty_write(tty_cmd_linefeed, &ttyctx); } *************** *** 985,991 **** struct screen_write_ctx *ctx, const struct grid_cell *gc, u_char *udata) { struct screen *s = ctx->s; - struct window_pane *wp = ctx->wp; struct grid *gd = s->grid; struct tty_ctx ttyctx; struct grid_utf8 gu, *tmp_gu; --- 975,980 ---- *************** *** 1062,1071 **** * leave the cursor to scroll naturally, unless this is only * part of the screen width. */ ! if (wp->xoff != 0 || wp->sx != screen_size_x(s)) ! screen_write_linefeed(ctx, 1); ! else ! screen_write_linefeedscreen(ctx, 1); s->cx = 0; /* carriage return */ } --- 1051,1057 ---- * leave the cursor to scroll naturally, unless this is only * part of the screen width. */ ! screen_write_linefeed(ctx, 1); s->cx = 0; /* carriage return */ }