mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-17 23:26:20 +00:00
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user