aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-03-31 20:01:34 +0100
committerThomas Adam <thomas@xteddy.org>2020-03-31 20:01:34 +0100
commitdfd29977e0ab289615eae0b4275763a3082bda24 (patch)
tree9e1753f4e3748cddfce46356d57044fe7ba49bf0 /grid.c
parent0bb1a50b88ac319e8f499fa95500f373123594d1 (diff)
parentcc8b41f294974cdfb1ddfe3b907da58374ff130f (diff)
downloadrtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.gz
rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.bz2
rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.zip
Merge branch 'obsd-master'
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/grid.c b/grid.c
index 29943e6b..9678bf59 100644
--- a/grid.c
+++ b/grid.c
@@ -351,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.