Compare commits
1 Commits
feat/ai-ap
...
de172f3533
| Author | SHA1 | Date | |
|---|---|---|---|
|
de172f3533
|
@@ -2001,7 +2001,19 @@ _win_print_internal(ProfWin* window, const char* show_char, int pad_indent, GDat
|
||||
}
|
||||
}
|
||||
|
||||
_win_ensure_pad_capacity(window, window->layout->win, getcury(window->layout->win));
|
||||
// reserve pad rows for this message's full height so a tall message isn't clipped at the pad bottom (a clipped height desyncs the scroll offset)
|
||||
int usable = getmaxx(window->layout->win) - (indent + pad_indent);
|
||||
if (usable < 1) {
|
||||
usable = 1;
|
||||
}
|
||||
int msg_nl = 0;
|
||||
for (const char* mp = message + offset; *mp; mp++) {
|
||||
if (*mp == '\n') {
|
||||
msg_nl++;
|
||||
}
|
||||
}
|
||||
int est_lines = msg_nl + (int)(utf8_display_len(message + offset) / usable) + 2;
|
||||
_win_ensure_pad_capacity(window, window->layout->win, getcury(window->layout->win) + est_lines);
|
||||
|
||||
if (prefs_get_boolean(PREF_WRAP)) {
|
||||
_win_print_wrapped(window->layout->win, message + offset, indent, pad_indent);
|
||||
|
||||
Reference in New Issue
Block a user