summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-09-11 15:39:56 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-09-11 15:39:56 +0000
commitd7738f748e236ab1d2d691e91c76276c12f00461 (patch)
tree88a8278f92f71e0b8f0fa03f39ce193e0ce3d223 /usr.bin
parent4fb68818c2fc8dfc1f8974426c45e15cfccb95af (diff)
When resizing the copy mode screen, don't allow it to end up with the
viewable position beyond the size of the history.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/window-copy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index c7ad610e28a..f4097c15e72 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.62 2010/09/08 20:36:42 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.63 2010/09/11 15:39:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -342,6 +342,8 @@ window_copy_resize(struct window_pane *wp, u_int sx, u_int sy)
data->cy = sy - 1;
if (data->cx > sx)
data->cx = sx;
+ if (data->oy > screen_hsize(data->backing))
+ data->oy = screen_hsize(data->backing);
window_copy_clear_selection(wp);