From c93e2f233206780ec1e2f0409c92326d06496a2d Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 19 Jun 2026 18:28:18 +0000 Subject: [PATCH] Do not loop forever if a pane ends up with borders the wrong way round. --- window-visible.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/window-visible.c b/window-visible.c index 7feb496d..f5b03447 100644 --- a/window-visible.c +++ b/window-visible.c @@ -131,6 +131,8 @@ window_visible_ranges(struct window_pane *base_wp, int px, int py, u_int width, for (i = 0; i < r->used; i++) { ri = &r->ranges[i]; + if (ri->nx == 0) + continue; if (no_border) { lb = wp->xoff; rb = wp->xoff + (int)wp->sx - 1; @@ -159,6 +161,8 @@ window_visible_ranges(struct window_pane *base_wp, int px, int py, u_int width, rb = w->sx - 1; else if (!no_border && rb > (int)w->sx) rb = w->sx - 1; + if (lb > rb) + continue; sx = ri->px; ex = sx + ri->nx - 1;