summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/grid.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-02-08 08:26:35 +0000
committernicm <nicm@openbsd.org>2017-02-08 08:26:35 +0000
commit26cd2289d22465968d2a7718b7b26ca45926917d (patch)
treeae89bf81cd17d7adf4ed88fbc88563347060d1ba /usr.bin/tmux/grid.c
parentRemove event watermarks, don't work well enough to be worth it. (diff)
downloadwireguard-openbsd-26cd2289d22465968d2a7718b7b26ca45926917d.tar.xz
wireguard-openbsd-26cd2289d22465968d2a7718b7b26ca45926917d.zip
Tweak how much we expand lines by.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r--usr.bin/tmux/grid.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c
index 3580a415383..ff1ac8dba93 100644
--- a/usr.bin/tmux/grid.c
+++ b/usr.bin/tmux/grid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid.c,v 1.61 2017/02/03 20:53:03 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.62 2017/02/08 08:26:35 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -292,11 +292,12 @@ grid_expand_line(struct grid *gd, u_int py, u_int sx, u_int bg)
if (sx <= gl->cellsize)
return;
- if (sx < gd->sx) {
- sx *= 2;
- if (sx > gd->sx)
- sx = gd->sx;
- }
+ if (sx < gd->sx / 4)
+ sx = gd->sx / 4;
+ else if (sx < gd->sx / 2)
+ sx = gd->sx / 2;
+ else
+ sx = gd->sx;
gl->celldata = xreallocarray(gl->celldata, sx, sizeof *gl->celldata);
for (xx = gl->cellsize; xx < sx; xx++)