When there are more than two horizontal windows and the active window is

in not on an edge, correctly highlight both its left and right borders.
GitHub issue 4513 from Michael Grant.
This commit is contained in:
nicm
2025-05-22 07:46:38 +00:00
parent 833c7fbf6d
commit a0ac2a5d63

View File

@ -121,7 +121,12 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
u_int ex = wp->xoff + wp->sx, ey = wp->yoff + wp->sy;
int hsplit = 0, vsplit = 0, pane_status = ctx->pane_status;
int pane_scrollbars = ctx->pane_scrollbars, sb_w = 0;
int sb_pos = ctx->pane_scrollbars_pos;
int sb_pos;
if (pane_scrollbars != 0)
sb_pos = ctx->pane_scrollbars_pos;
else
sb_pos = 0;
/* Inside pane. */
if (px >= wp->xoff && px < ex && py >= wp->yoff && py < ey)
@ -149,16 +154,24 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
if (wp->xoff - sb_w == 0 && px == wp->sx + sb_w)
if (!hsplit || (hsplit && py <= wp->sy / 2))
return (SCREEN_REDRAW_BORDER_RIGHT);
if (wp->xoff - sb_w != 0 && px == wp->xoff - sb_w - 1)
if (!hsplit || (hsplit && py > wp->sy / 2))
if (wp->xoff - sb_w != 0) {
if (px == wp->xoff - sb_w - 1 &&
(!hsplit || (hsplit && py > wp->sy / 2)))
return (SCREEN_REDRAW_BORDER_LEFT);
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT */
if (px == wp->xoff + wp->sx + sb_w - 1)
return (SCREEN_REDRAW_BORDER_RIGHT);
}
} else { /* sb_pos == PANE_SCROLLBARS_RIGHT or disabled*/
if (wp->xoff == 0 && px == wp->sx + sb_w)
if (!hsplit || (hsplit && py <= wp->sy / 2))
return (SCREEN_REDRAW_BORDER_RIGHT);
if (wp->xoff != 0 && px == wp->xoff - 1)
if (!hsplit || (hsplit && py > wp->sy / 2))
if (wp->xoff != 0) {
if (px == wp->xoff - 1 &&
(!hsplit || (hsplit && py > wp->sy / 2)))
return (SCREEN_REDRAW_BORDER_LEFT);
if (px == wp->xoff + wp->sx + sb_w)
return (SCREEN_REDRAW_BORDER_RIGHT);
}
}
}