diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-09-03 00:01:14 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-09-03 00:01:14 +0100 |
commit | 999c1c771b4282c60017b86b26f03136398ae09c (patch) | |
tree | d2dd889dc153371f662af992e586c0898d48321c /screen.c | |
parent | 727ce7e4bb19038b7952c7330b045ac6e1216ede (diff) | |
parent | 2627ab322e0e8dffbf86b1c2eb969139a8062174 (diff) | |
download | rtmux-999c1c771b4282c60017b86b26f03136398ae09c.tar.gz rtmux-999c1c771b4282c60017b86b26f03136398ae09c.tar.bz2 rtmux-999c1c771b4282c60017b86b26f03136398ae09c.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -177,8 +177,9 @@ screen_resize_y(struct screen *s, u_int sy) * If the height is decreasing, delete lines from the bottom until * hitting the cursor, then push lines from the top into the history. * - * When increasing, pull as many lines as possible from the history to - * the top, then fill the remaining with blanks at the bottom. + * When increasing, pull as many lines as possible from scrolled + * history (not explicitly cleared from view) to the top, then fill the + * remaining with blanks at the bottom. */ /* Size decreasing. */ @@ -200,9 +201,10 @@ screen_resize_y(struct screen *s, u_int sy) * lines from the top. */ available = s->cy; - if (gd->flags & GRID_HISTORY) + if (gd->flags & GRID_HISTORY) { + gd->hscrolled += needed; gd->hsize += needed; - else if (needed > 0 && available > 0) { + } else if (needed > 0 && available > 0) { if (available > needed) available = needed; grid_view_delete_lines(gd, 0, available); @@ -219,13 +221,14 @@ screen_resize_y(struct screen *s, u_int sy) needed = sy - oldy; /* - * Try to pull as much as possible out of the history, if is + * Try to pull as much as possible out of scrolled history, if is * is enabled. */ - available = gd->hsize; + available = gd->hscrolled; if (gd->flags & GRID_HISTORY && available > 0) { if (available > needed) available = needed; + gd->hscrolled -= available; gd->hsize -= available; s->cy += available; } else |