mirror of
https://github.com/tmate-io/tmate.git
synced 2024-12-23 07:09:10 +01:00
Code tidying.
This commit is contained in:
parent
c5b1fa9411
commit
97eca99d0b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user