fix(ui): reclaim pad by dead space instead of absolute height #135
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/pad-dead-space-reclaim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up hardening to #133.
#133 raised PAD_THRESHOLD to 12000, but the reclaim redraw still keys off absolute pad height, so a single oversized message (huge paste, narrow terminal, crafted incoming) whose live render ≥ threshold re-enters win_redraw() from the print path on every message — the redraw storm again, and the message gets clipped.
This switches the trigger to dead space (getcury - buffer->lines). After a redraw the cursor equals buffer->lines, so dead space is 0 regardless of buffer size: the reclaim can never fire while scrolling, an oversized message no longer storms and renders in full. Dead space only accrues in a long append-only session that trimmed old entries — exactly when reclaiming is wanted.
1 file, +5/-4.
Testing (pending): scroll a >9000-line history to the top; receive/paste a ≥15000-line message; long append-only session (memory bound); narrow terminal (~40 cols).
Fixes #43
WIP: fix(ui): reclaim pad by dead space instead of absolute heightto fix(ui): reclaim pad by dead space instead of absolute height3fd48a1f44to5acd062c2dfix(ui): reclaim pad by dead space instead of absolute heightto WIP: fix(ui): reclaim pad by dead space instead of absolute heightWIP: fix(ui): reclaim pad by dead space instead of absolute heightto fix(ui): reclaim pad by dead space instead of absolute height5acd062c2dtoe33874e6b5fix(ui): reclaim pad by dead space instead of absolute heightto WIP: fix(ui): reclaim pad by dead space instead of absolute heightWIP: fix(ui): reclaim pad by dead space instead of absolute heightto fix(ui): reclaim pad by dead space instead of absolute heightLGTM
@@ -44,3 +44,3 @@static const int PAD_MIN_HEIGHT = 100;static const int PAD_THRESHOLD = 12000; // above buffer cap (~9000): reclaims dead pad space, never fires while scrollingstatic const int PAD_DEAD_SPACE_LIMIT = 2000; // reclaim once the pad holds this much dead space (cursor past live buffer); size-independent, so it never fires while scrollingwhy it "it never fires while scrolling"?