=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen.c,v retrieving revision 1.7 retrieving revision 1.8 diff -c -r1.7 -r1.8 *** src/usr.bin/tmux/screen.c 2009/07/09 22:48:20 1.7 --- src/usr.bin/tmux/screen.c 2009/07/13 10:43:52 1.8 *************** *** 1,4 **** ! /* $OpenBSD: screen.c,v 1.7 2009/07/09 22:48:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen.c,v 1.8 2009/07/13 10:43:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 174,183 **** needed -= available; /* ! * Now just increase the history size to take over the lines ! * which are left. XXX Should apply history limit? */ ! gd->hsize += needed; s->cy -= needed; } --- 174,193 ---- needed -= available; /* ! * Now just increase the history size, if possible, to take ! * over the lines which are left. If history is off, delete ! * lines from the top. ! * ! * XXX Should apply history limit? */ ! available = s->cy; ! if (gd->flags & GRID_HISTORY) ! gd->hsize += needed; ! else if (available > 0) { ! if (available > needed) ! available = needed; ! grid_view_delete_lines(gd, 0, available); ! } s->cy -= needed; } *************** *** 191,204 **** if (sy > oldy) { needed = sy - oldy; ! /* Try to pull as much as possible out of the history. */ available = gd->hsize; ! if (available > 0) { if (available > needed) available = needed; gd->hsize -= available; s->cy += available; ! } needed -= available; /* Then fill the rest in with blanks. */ --- 201,218 ---- if (sy > oldy) { needed = sy - oldy; ! /* ! * Try to pull as much as possible out of the history, if is ! * is enabled. ! */ available = gd->hsize; ! if (gd->flags & GRID_HISTORY && available > 0) { if (available > needed) available = needed; gd->hsize -= available; s->cy += available; ! } else ! available = 0; needed -= available; /* Then fill the rest in with blanks. */