Problem:
  When set pane-border-status top or bottom, 
  select-pane -U and -D cannot cycle.
  eg:
     set pane-boder-status top
     split-window -h
     select-pane -t 0
     select-pane -U
        # pane 1 should be selected, but
        # pane 0 is selected.
Version: git 640666f
OS: FreeBSD 11.0
Sample patch:
  When pane-border-status is off, one border line is inserted at top or bottom.
  This line must be considered.
--- a/window.c
+++ b/window.c
@@ -1320,17 +1320,19 @@ window_pane_find_up(struct window_pane *
 {
        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;
@@ -1366,17 +1368,19 @@ window_pane_find_down(struct window_pane
 {
        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;

--
KOIE Hidetaka <[email protected]>

Reply via email to