fix(ui): reserve pad height per message to prevent multi-line clip and scroll desync #136
@@ -72,10 +72,7 @@ _win_ensure_pad_capacity(ProfWin* window, WINDOW* win, int lines_needed)
|
||||
static int
|
||||
_win_estimated_lines(WINDOW* win, const char* const message, int indent, int pad_indent)
|
||||
{
|
||||
int usable = getmaxx(win) - (indent + pad_indent);
|
||||
if (usable < 1) {
|
||||
usable = 1;
|
||||
}
|
||||
int usable = MAX(1, getmaxx(win) - (indent + pad_indent));
|
||||
int newlines = 0;
|
||||
|
jabber.developer marked this conversation as resolved
Outdated
|
||||
for (const char* p = message; *p; p++) {
|
||||
if (*p == '\n') {
|
||||
|
||||
Reference in New Issue
Block a user
We might also use
MAX(1, ...)instead, but this variant is also fine.Agreed, used MAX instead