summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
-rw-r--r--usr.bin/tmux/window-copy.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index c2d64ed4be7..96fb55ce871 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.19 2009/08/13 22:11:43 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.20 2009/08/13 22:32:18 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -203,6 +203,24 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
window_copy_update_selection(wp);
window_copy_redraw_screen(wp);
break;
+ case MODEKEYCOPY_HALFPAGEUP:
+ n = screen_size_y(s) / 2;
+ if (data->oy + n > screen_hsize(&wp->base))
+ data->oy = screen_hsize(&wp->base);
+ else
+ data->oy += n;
+ window_copy_update_selection(wp);
+ window_copy_redraw_screen(wp);
+ break;
+ case MODEKEYCOPY_HALFPAGEDOWN:
+ n = screen_size_y(s) / 2;
+ if (data->oy < n)
+ data->oy = 0;
+ else
+ data->oy -= n;
+ window_copy_update_selection(wp);
+ window_copy_redraw_screen(wp);
+ break;
case MODEKEYCOPY_STARTSELECTION:
window_copy_start_selection(wp);
window_copy_redraw_screen(wp);