=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- src/usr.bin/tmux/screen-write.c 2009/07/30 20:41:48 1.19 +++ src/usr.bin/tmux/screen-write.c 2009/08/08 15:57:49 1.20 @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.19 2009/07/30 20:41:48 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.20 2009/08/08 15:57:49 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -610,13 +610,20 @@ /* Line feed (down with scroll). */ void -screen_write_linefeed(struct screen_write_ctx *ctx) +screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped) { - struct screen *s = ctx->s; - struct tty_ctx ttyctx; + struct screen *s = ctx->s; + struct grid_line *gl; + struct tty_ctx ttyctx; screen_write_initctx(ctx, &ttyctx); + gl = &s->grid->linedata[s->grid->hsize + s->cy]; + if (wrapped) + gl->flags |= GRID_LINE_WRAPPED; + else + gl->flags &= ~GRID_LINE_WRAPPED; + if (s->cy == s->rlower) grid_view_scroll_region_up(s->grid, s->rupper, s->rlower); else if (s->cy < screen_size_y(s) - 1) @@ -782,10 +789,10 @@ insert = 1; } - /* Check this will fit on the current line; scroll if not. */ + /* Check this will fit on the current line and wrap if not. */ if (s->cx > screen_size_x(s) - width) { screen_write_carriagereturn(ctx); - screen_write_linefeed(ctx); + screen_write_linefeed(ctx, 1); } /* Sanity checks. */