aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/grid.c b/grid.c
index b2031045..9678bf59 100644
--- a/grid.c
+++ b/grid.c
@@ -258,7 +258,10 @@ grid_create(u_int sx, u_int sy, u_int hlimit)
gd->sx = sx;
gd->sy = sy;
- gd->flags = GRID_HISTORY;
+ if (hlimit != 0)
+ gd->flags = GRID_HISTORY;
+ else
+ gd->flags = 0;
gd->hscrolled = 0;
gd->hsize = 0;
@@ -348,6 +351,19 @@ grid_collect_history(struct grid *gd)
gd->hscrolled = gd->hsize;
}
+/* Remove lines from the bottom of the history. */
+void
+grid_remove_history(struct grid *gd, u_int ny)
+{
+ u_int yy;
+
+ if (ny > gd->hsize)
+ return;
+ for (yy = 0; yy < ny; yy++)
+ grid_free_line(gd, gd->hsize + gd->sy - 1 - yy);
+ gd->hsize -= ny;
+}
+
/*
* Scroll the entire visible screen, moving one line into the history. Just
* allocate a new line at the bottom and move the history size indicator.
@@ -755,15 +771,15 @@ grid_string_cells_bg(const struct grid_cell *gc, int *values)
case 8:
values[n++] = 49;
break;
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- values[n++] = gc->bg - 10;
+ case 90:
+ case 91:
+ case 92:
+ case 93:
+ case 94:
+ case 95:
+ case 96:
+ case 97:
+ values[n++] = gc->bg + 10;
break;
}
}