=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.165 retrieving revision 1.166 diff -c -r1.165 -r1.166 *** src/usr.bin/tmux/window-copy.c 2017/02/03 11:57:28 1.165 --- src/usr.bin/tmux/window-copy.c 2017/02/08 17:33:51 1.166 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.165 2017/02/03 11:57:28 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.166 2017/02/08 17:33:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 29,35 **** struct session *, struct args *, struct mouse_event *); static struct screen *window_copy_init(struct window_pane *); static void window_copy_free(struct window_pane *); ! static void window_copy_pagedown(struct window_pane *, int); static void window_copy_next_paragraph(struct window_pane *); static void window_copy_previous_paragraph(struct window_pane *); static void window_copy_resize(struct window_pane *, u_int, u_int); --- 29,35 ---- struct session *, struct args *, struct mouse_event *); static struct screen *window_copy_init(struct window_pane *); static void window_copy_free(struct window_pane *); ! static int window_copy_pagedown(struct window_pane *, int); static void window_copy_next_paragraph(struct window_pane *); static void window_copy_previous_paragraph(struct window_pane *); static void window_copy_resize(struct window_pane *, u_int, u_int); *************** *** 380,386 **** window_copy_redraw_screen(wp); } ! static void window_copy_pagedown(struct window_pane *wp, int half_page) { struct window_copy_mode_data *data = wp->modedata; --- 380,386 ---- window_copy_redraw_screen(wp); } ! static int window_copy_pagedown(struct window_pane *wp, int half_page) { struct window_copy_mode_data *data = wp->modedata; *************** *** 420,432 **** window_copy_cursor_end_of_line(wp); } ! if (data->scroll_exit && data->oy == 0) { ! window_pane_reset_mode(wp); ! return; ! } ! window_copy_update_selection(wp, 1); window_copy_redraw_screen(wp); } static void --- 420,430 ---- window_copy_cursor_end_of_line(wp); } ! if (data->scroll_exit && data->oy == 0) ! return (1); window_copy_update_selection(wp, 1); window_copy_redraw_screen(wp); + return (0); } static void *************** *** 621,628 **** if (strcmp(command, "end-of-line") == 0) window_copy_cursor_end_of_line(wp); if (strcmp(command, "halfpage-down") == 0) { ! for (; np != 0; np--) ! window_copy_pagedown(wp, 1); } if (strcmp(command, "halfpage-up") == 0) { for (; np != 0; np--) --- 619,630 ---- if (strcmp(command, "end-of-line") == 0) window_copy_cursor_end_of_line(wp); if (strcmp(command, "halfpage-down") == 0) { ! for (; np != 0; np--) { ! if (window_copy_pagedown(wp, 1)) { ! cancel = 1; ! break; ! } ! } } if (strcmp(command, "halfpage-up") == 0) { for (; np != 0; np--) *************** *** 715,722 **** window_copy_other_end(wp); } if (strcmp(command, "page-down") == 0) { ! for (; np != 0; np--) ! window_copy_pagedown(wp, 0); } if (strcmp(command, "page-up") == 0) { for (; np != 0; np--) --- 717,728 ---- window_copy_other_end(wp); } if (strcmp(command, "page-down") == 0) { ! for (; np != 0; np--) { ! if (window_copy_pagedown(wp, 0)) { ! cancel = 1; ! break; ! } ! } } if (strcmp(command, "page-up") == 0) { for (; np != 0; np--)