Preserve the last blank line on reflow

weechat-hashes
C. McEnroe 2020-04-02 10:56:33 -04:00
parent 6333b63224
commit 9063c656d5
1 changed files with 6 additions and 1 deletions

7
ui.c
View File

@ -636,7 +636,12 @@ static void reflow(struct Window *window) {
struct Line line = bufferLine(&window->buffer, i);
if (!line.str) continue;
if (line.heat < Cold && window->ignore) continue;
int lines = wordWrap(window->pad, line.str);
int lines = 0;
if (i == (size_t)(BufferCap - window->unread)) {
waddch(window->pad, '\n');
lines++;
}
lines += wordWrap(window->pad, line.str);
if (i >= (size_t)(BufferCap - window->unread)) {
window->unreadLines += lines;
}