From d28c9f613d0ae19abbf6a34fa0f105ef9e6d3a64 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 28 Aug 2026 10:25:42 +0100 Subject: [PATCH] Do not loop forever if a pane ends up with borders the wrong way round. --- screen-redraw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/screen-redraw.c b/screen-redraw.c index e1d8c6289..a5496e1b1 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1201,6 +1201,8 @@ screen_redraw_get_visible_ranges(struct window_pane *base_wp, int px, for (i = 0; i < r->used; i++) { ri = &r->ranges[i]; + if (ri->nx == 0) + continue; if (w->sb_pos == PANE_SCROLLBARS_LEFT) { if (wp->xoff > sb_w) lb = wp->xoff - 1 - sb_w; @@ -1218,6 +1220,8 @@ screen_redraw_get_visible_ranges(struct window_pane *base_wp, int px, rb = wp->xoff + wp->sx + sb_w; if (rb > (int)w->sx) rb = w->sx - 1; + if (lb > rb) + continue; sx = ri->px; ex = sx + ri->nx - 1;