From 36512d9ddef4cbb250f3409c588168b5b109ca66 Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Tue, 23 Jun 2026 14:18:37 +0300 Subject: [PATCH] fix(ui): measure dead pad space from the cursor, not the requested lines _win_print_internal now calls _win_ensure_pad_capacity() with getcury() plus the estimated message height, so deriving 'dead' from lines_needed counted that lookahead reservation as dead space. Compute it from getcury(win) directly so the reclaim keys off the real cursor-vs-buffer gap. --- src/ui/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/window.c b/src/ui/window.c index a9a99f85..4cbbbb71 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -58,7 +58,7 @@ _win_ensure_pad_capacity(ProfWin* window, WINDOW* win, int lines_needed) if (lines_needed >= cur_height - 1) { // redraw to reclaim dead pad space (cursor far past live buffer, e.g. a long // append-only session); dead space never accrues while scrolling, only here - int dead = window ? lines_needed - window->layout->buffer->lines : 0; + int dead = window ? getcury(win) - window->layout->buffer->lines : 0; if (window && dead > PAD_DEAD_SPACE_LIMIT && !_in_redraw) { win_redraw(window); } else {