Fix pane movement by direction (up, down, left, right) when

pane-border-status is set, from KOIE Hidetaka.
pull/834/head
nicm 2017-03-21 09:49:10 +00:00
parent 67d2335130
commit c916feaf29
1 changed files with 9 additions and 7 deletions

View File

@ -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;