=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window-copy.c,v retrieving revision 1.229 retrieving revision 1.230 diff -c -r1.229 -r1.230 *** src/usr.bin/tmux/window-copy.c 2019/08/01 14:30:31 1.229 --- src/usr.bin/tmux/window-copy.c 2019/08/01 14:31:39 1.230 *************** *** 1,4 **** ! /* $OpenBSD: window-copy.c,v 1.229 2019/08/01 14:30:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: window-copy.c,v 1.230 2019/08/01 14:31:39 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 60,67 **** static int window_copy_search_marks(struct window_mode_entry *, struct screen *); static void window_copy_clear_marks(struct window_mode_entry *); ! static void window_copy_move_left(struct screen *, u_int *, u_int *); ! static void window_copy_move_right(struct screen *, u_int *, u_int *); static int window_copy_is_lowercase(const char *); static int window_copy_search_jump(struct window_mode_entry *, struct grid *, struct grid *, u_int, u_int, u_int, int, int, --- 60,67 ---- static int window_copy_search_marks(struct window_mode_entry *, struct screen *); static void window_copy_clear_marks(struct window_mode_entry *); ! static void window_copy_move_left(struct screen *, u_int *, u_int *, int); ! static void window_copy_move_right(struct screen *, u_int *, u_int *, int); static int window_copy_is_lowercase(const char *); static int window_copy_search_jump(struct window_mode_entry *, struct grid *, struct grid *, u_int, u_int, u_int, int, int, *************** *** 2047,2057 **** } static void ! window_copy_move_left(struct screen *s, u_int *fx, u_int *fy) { if (*fx == 0) { /* left */ ! if (*fy == 0) /* top */ return; *fx = screen_size_x(s) - 1; *fy = *fy - 1; } else --- 2047,2062 ---- } static void ! window_copy_move_left(struct screen *s, u_int *fx, u_int *fy, int wrapflag) { if (*fx == 0) { /* left */ ! if (*fy == 0) { /* top */ ! if (wrapflag) { ! *fx = screen_size_x(s) - 1; ! *fy = screen_hsize(s) + screen_size_y(s); ! } return; + } *fx = screen_size_x(s) - 1; *fy = *fy - 1; } else *************** *** 2059,2069 **** } static void ! window_copy_move_right(struct screen *s, u_int *fx, u_int *fy) { if (*fx == screen_size_x(s) - 1) { /* right */ ! if (*fy == screen_hsize(s) + screen_size_y(s)) /* bottom */ return; *fx = 0; *fy = *fy + 1; } else --- 2064,2079 ---- } static void ! window_copy_move_right(struct screen *s, u_int *fx, u_int *fy, int wrapflag) { if (*fx == screen_size_x(s) - 1) { /* right */ ! if (*fy == screen_hsize(s) + screen_size_y(s)) { /* bottom */ ! if (wrapflag) { ! *fx = 0; ! *fy = 0; ! } return; + } *fx = 0; *fy = *fy + 1; } else *************** *** 2155,2172 **** screen_write_nputs(&ctx, -1, &grid_default_cell, "%s", data->searchstr); screen_write_stop(&ctx); - if (direction) - window_copy_move_right(s, &fx, &fy); - else - window_copy_move_left(s, &fx, &fy); - wrapflag = options_get_number(wp->window->options, "wrap-search"); cis = window_copy_is_lowercase(data->searchstr); ! if (direction) endline = gd->hsize + gd->sy - 1; ! else endline = 0; found = window_copy_search_jump(wme, gd, ss.grid, fx, fy, endline, cis, wrapflag, direction); --- 2165,2180 ---- screen_write_nputs(&ctx, -1, &grid_default_cell, "%s", data->searchstr); screen_write_stop(&ctx); wrapflag = options_get_number(wp->window->options, "wrap-search"); cis = window_copy_is_lowercase(data->searchstr); ! if (direction) { ! window_copy_move_right(s, &fx, &fy, wrapflag); endline = gd->hsize + gd->sy - 1; ! } else { ! window_copy_move_left(s, &fx, &fy, wrapflag); endline = 0; + } found = window_copy_search_jump(wme, gd, ss.grid, fx, fy, endline, cis, wrapflag, direction);