aboutsummaryrefslogtreecommitdiff
path: root/grid-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/grid-view.c b/grid-view.c
index 98624e10..e7072543 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -1,4 +1,4 @@
-/* $Id: grid-view.c,v 1.20 2009-12-04 22:14:47 tcunha Exp $ */
+/* $Id: grid-view.c,v 1.21 2011-02-15 15:10:47 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -74,6 +74,30 @@ grid_view_set_utf8(
grid_set_utf8(gd, grid_view_x(gd, px), grid_view_y(gd, py), gu);
}
+/* Clear into history. */
+void
+grid_view_clear_history(struct grid *gd)
+{
+ struct grid_line *gl;
+ u_int yy, last;
+
+ GRID_DEBUG(gd, "");
+
+ /* Find the last used line. */
+ last = 0;
+ for (yy = 0; yy < gd->sy; yy++) {
+ gl = &gd->linedata[grid_view_y(gd, yy)];
+ if (gl->cellsize != 0 || gl->utf8size != 0)
+ last = yy + 1;
+ }
+ if (last == 0)
+ return;
+
+ /* Scroll the lines into the history. */
+ for (yy = 0; yy < last; yy++)
+ grid_scroll_history(gd);
+}
+
/* Clear area. */
void
grid_view_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny)