mirror of
https://github.com/tmux/tmux.git
synced 2025-09-04 15:26:58 +00:00
Merge branch 'obsd-master'
This commit is contained in:
20
screen.c
20
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user