aboutsummaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-09 14:53:51 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-09 14:53:51 +0000
commit648ce2f56adc071f93516887cf4a4c32f631d54e (patch)
treec0d2438bd54d426e6dab3fbcd833ce3408adc215 /screen.c
parent0648c587162da4eae0805e35805454c46be70321 (diff)
parent01da28efb112ef2096a80da616ca190d59ba9b52 (diff)
downloadrtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.tar.gz
rtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.tar.bz2
rtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 64713728..fe0b7389 100644
--- a/screen.c
+++ b/screen.c
@@ -121,7 +121,7 @@ screen_set_title(struct screen *s, const char *title)
/* Resize screen. */
void
-screen_resize(struct screen *s, u_int sx, u_int sy)
+screen_resize(struct screen *s, u_int sx, u_int sy, int reflow)
{
if (sx < 1)
sx = 1;
@@ -141,6 +141,9 @@ screen_resize(struct screen *s, u_int sx, u_int sy)
if (sy != screen_size_y(s))
screen_resize_y(s, sy);
+
+ if (reflow)
+ screen_reflow(s, sx);
}
void
@@ -357,3 +360,18 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
return (1);
}
+
+/* Reflow wrapped lines. */
+void
+screen_reflow(struct screen *s, u_int sx)
+{
+ struct grid *old, *new;
+
+ old = s->grid;
+ new = grid_create(old->sx, old->sy, old->hlimit);
+
+ s->cy -= grid_reflow(new, old, sx);
+ s->grid = new;
+
+ grid_destroy(old);
+}