diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-26 22:22:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-26 22:22:18 +0000 |
commit | 97eca99d0bae6c4fdfc38a6f42d42f05c8faac4b (patch) | |
tree | a7d69d6642a1f97fd948d8bf9a98159d34c640a8 /screen-display.c | |
parent | c5b1fa9411300725ea78964db8af995fdf7af7da (diff) |
Code tidying.
Diffstat (limited to 'screen-display.c')
-rw-r--r-- | screen-display.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/screen-display.c b/screen-display.c index 1fb137d9..1985570e 100644 --- a/screen-display.c +++ b/screen-display.c @@ -1,4 +1,4 @@ -/* $Id: screen-display.c,v 1.8 2007-11-26 22:18:57 nicm Exp $ */ +/* $Id: screen-display.c,v 1.9 2007-11-26 22:22:18 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -174,28 +174,25 @@ screen_display_scroll_region_up(struct screen *s) * XXX should this be done somewhere else? */ if (s->rupper == 0 && s->rlower == screen_last_y(s)) { - sy = screen_size_y(s) + s->hsize; if (s->hsize == s->hlimit) { /* If the limit is hit, free 10% and shift up. */ ny = s->hlimit / 10; if (ny < 1) ny = 1; + + sy = screen_size_y(s) + s->hsize; screen_free_lines(s, 0, ny); screen_move_lines(s, 0, ny, sy - ny); s->hsize -= ny; - sy -= ny; } s->hsize++; - s->grid_data = xrealloc( - s->grid_data, sy + 1, sizeof *s->grid_data); - s->grid_attr = xrealloc( - s->grid_attr, sy + 1, sizeof *s->grid_attr); - s->grid_colr = xrealloc( - s->grid_colr, sy + 1, sizeof *s->grid_colr); - s->grid_size = xrealloc( - s->grid_size, sy + 1, sizeof *s->grid_size); + sy = screen_size_y(s) + s->hsize; + s->grid_data = xrealloc(s->grid_data, sy, sizeof *s->grid_data); + s->grid_attr = xrealloc(s->grid_attr, sy, sizeof *s->grid_attr); + s->grid_colr = xrealloc(s->grid_colr, sy, sizeof *s->grid_colr); + s->grid_size = xrealloc(s->grid_size, sy, sizeof *s->grid_size); screen_display_make_lines(s, screen_last_y(s), 1); return; } |