From d2c23773ff8902611b2d56346868a90558203d8b Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 16 Jun 2026 08:53:14 +0000 Subject: [PATCH] Fix missing border when drawing floating panes. From Michael Grant. --- screen-redraw.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/screen-redraw.c b/screen-redraw.c index 022f7bf0..a9a62680 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -129,7 +129,7 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp, int hsplit = 0, vsplit = 0; int pane_status = window_pane_get_pane_status(wp); int pane_scrollbars = ctx->pane_scrollbars, sb_w = 0; - int sb_pos, sx = wp->sx, sy = wp->sy; + int sb_pos, sx = wp->sx, sy = wp->sy, left, right; enum layout_type split_type; if (pane_scrollbars != 0) @@ -151,20 +151,19 @@ screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp, /* Floating pane borders. */ if (window_pane_is_floating(wp)) { + left = wp->xoff - 1; + right = wp->xoff + sx; + if (sb_pos == PANE_SCROLLBARS_LEFT) + left -= sb_w; + else + right += sb_w; if (py >= wp->yoff - 1 && py <= wp->yoff + sy) { - if (sb_pos == PANE_SCROLLBARS_LEFT) { - if (px == wp->xoff - 1 - sb_w) - return (SCREEN_REDRAW_BORDER_LEFT); - if (px == wp->xoff + sx) - return (SCREEN_REDRAW_BORDER_RIGHT); - } else { /* PANE_SCROLLBARS_RIGHT or none. */ - if (px == wp->xoff - 1) - return (SCREEN_REDRAW_BORDER_LEFT); - if (px == wp->xoff + sx + sb_w) - return (SCREEN_REDRAW_BORDER_RIGHT); - } + if (px == left) + return (SCREEN_REDRAW_BORDER_LEFT); + if (px == right) + return (SCREEN_REDRAW_BORDER_RIGHT); } - if (px >= wp->xoff && px <= wp->xoff + sx) { + if (px > left && px <= right) { if (py == wp->yoff - 1) return (SCREEN_REDRAW_BORDER_TOP); if (py == wp->yoff + sy)