summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/screen.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-11-15 19:21:24 +0000
committernicm <nicm@openbsd.org>2017-11-15 19:21:24 +0000
commit414c61adb98caf0e1330a0138968ad5bb58c8e0c (patch)
tree33b8ca17495bb3e94466f06f02f7203b9088531b /usr.bin/tmux/screen.c
parentIf there is a double width character at the very end of the line with (diff)
downloadwireguard-openbsd-414c61adb98caf0e1330a0138968ad5bb58c8e0c.tar.xz
wireguard-openbsd-414c61adb98caf0e1330a0138968ad5bb58c8e0c.zip
Completely rewrite the reflow code to correctly handle double width
characters (previously they were not accounted for).
Diffstat (limited to 'usr.bin/tmux/screen.c')
-rw-r--r--usr.bin/tmux/screen.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c
index 2963c55aa9d..83ee65edbe8 100644
--- a/usr.bin/tmux/screen.c
+++ b/usr.bin/tmux/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.49 2017/11/02 18:26:38 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.50 2017/11/15 19:21:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -470,14 +470,5 @@ screen_select_cell(struct screen *s, struct grid_cell *dst,
static void
screen_reflow(struct screen *s, u_int new_x)
{
- struct grid *old = s->grid;
- u_int change;
-
- s->grid = grid_create(old->sx, old->sy, old->hlimit);
-
- change = grid_reflow(s->grid, old, new_x);
- if (change < s->cy)
- s->cy -= change;
- else
- s->cy = 0;
+ grid_reflow(s->grid, new_x, &s->cy);
}