=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.118 retrieving revision 1.119 diff -c -r1.118 -r1.119 *** src/usr.bin/tmux/window-copy.c 2014/11/06 09:17:26 1.118 --- src/usr.bin/tmux/window-copy.c 2014/11/06 10:56:44 1.119 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.118 2014/11/06 09:17:26 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.119 2014/11/06 10:56:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 239,245 **** data->backing = xmalloc(sizeof *data->backing); screen_init(data->backing, screen_size_x(&wp->base), screen_size_y(&wp->base), UINT_MAX); - data->backing->mode &= ~MODE_WRAP; } void --- 239,244 ---- *************** *** 280,286 **** struct screen_write_ctx back_ctx, ctx; struct grid_cell gc; int utf8flag; ! u_int old_hsize; if (backing == &wp->base) return; --- 279,285 ---- struct screen_write_ctx back_ctx, ctx; struct grid_cell gc; int utf8flag; ! u_int old_hsize, old_cy; if (backing == &wp->base) return; *************** *** 299,304 **** --- 298,304 ---- screen_write_linefeed(&back_ctx, 0); } else data->backing_written = 1; + old_cy = backing->cy; screen_write_vnputs(&back_ctx, 0, &gc, utf8flag, fmt, ap); screen_write_stop(&back_ctx); *************** *** 313,321 **** if (screen_hsize(data->backing)) window_copy_redraw_lines(wp, 0, 1); ! /* Write the line, if it's visible. */ ! if (backing->cy + data->oy < screen_size_y(backing)) ! window_copy_redraw_lines(wp, backing->cy, 1); screen_write_stop(&ctx); } --- 313,320 ---- if (screen_hsize(data->backing)) window_copy_redraw_lines(wp, 0, 1); ! /* Write the new lines. */ ! window_copy_redraw_lines(wp, old_cy, backing->cy - old_cy + 1); screen_write_stop(&ctx); } *************** *** 345,353 **** struct screen *s = &data->screen; struct screen_write_ctx ctx; ! screen_resize(s, sx, sy, 0); if (data->backing != &wp->base) ! screen_resize(data->backing, sx, sy, 0); if (data->cy > sy - 1) data->cy = sy - 1; --- 344,352 ---- struct screen *s = &data->screen; struct screen_write_ctx ctx; ! screen_resize(s, sx, sy, 1); if (data->backing != &wp->base) ! screen_resize(data->backing, sx, sy, 1); if (data->cy > sy - 1) data->cy = sy - 1;