diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-03-21 09:49:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-03-21 09:49:11 +0000 |
commit | 6fe477ae22c1359c5867252eeb19640bef4e31d6 (patch) | |
tree | 792e190e7df358b26b33528ca00e3866c73d2c6e | |
parent | 5e556c434006346c60d44b1bb91055d48ecacecd (diff) |
Fix pane movement by direction (up, down, left, right) when
pane-border-status is set, from KOIE Hidetaka.
-rw-r--r-- | usr.bin/tmux/window.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index d661408b1bc..b4ccd5dac49 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.186 2017/03/13 17:20:11 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.187 2017/03/21 09:49:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1257,7 +1257,7 @@ window_pane_search(struct window_pane *wp, const char *searchstr, { struct screen *s = &wp->base; char *newsearchstr, *line, *msg; - u_int i; + u_int i; msg = NULL; xasprintf(&newsearchstr, "*%s*", searchstr); @@ -1305,17 +1305,18 @@ window_pane_find_up(struct window_pane *wp) { struct window_pane *next, *best, **list; u_int edge, left, right, end, size; - int found; + int status, found; if (wp == NULL || !window_pane_visible(wp)) return (NULL); + status = options_get_number(wp->window->options, "pane-border-status"); list = NULL; size = 0; edge = wp->yoff; - if (edge == 0) - edge = wp->window->sy + 1; + if (edge == (status == 1 ? 1 : 0)) + edge = wp->window->sy + 1 - (status == 2 ? 1 : 0); left = wp->xoff; right = wp->xoff + wp->sx; @@ -1351,17 +1352,18 @@ window_pane_find_down(struct window_pane *wp) { struct window_pane *next, *best, **list; u_int edge, left, right, end, size; - int found; + int status, found; if (wp == NULL || !window_pane_visible(wp)) return (NULL); + status = options_get_number(wp->window->options, "pane-border-status"); list = NULL; size = 0; edge = wp->yoff + wp->sy + 1; - if (edge >= wp->window->sy) - edge = 0; + if (edge >= wp->window->sy - (status == 2 ? 1 : 0)) + edge = (status == 1 ? 1 : 0); left = wp->xoff; right = wp->xoff + wp->sx; |