From 9063c656d516b1842f9078cd9bb4cd5f1fd4a14a Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Thu, 2 Apr 2020 10:56:33 -0400 Subject: Preserve the last blank line on reflow --- ui.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui.c b/ui.c index 023de21..f4e1200 100644 --- a/ui.c +++ b/ui.c @@ -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; } -- cgit 1.4.1-2-gfad0