about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-02 10:56:33 -0400
committerJune McEnroe <june@causal.agency>2020-04-02 10:56:33 -0400
commit9063c656d516b1842f9078cd9bb4cd5f1fd4a14a (patch)
tree89d79e5784c4a2d6a3d9af8ee1e4d02a8ea90b40
parentSwitch to windows with ascending unread counts on M-a (diff)
downloadcatgirl-9063c656d516b1842f9078cd9bb4cd5f1fd4a14a.tar.gz
catgirl-9063c656d516b1842f9078cd9bb4cd5f1fd4a14a.zip
Preserve the last blank line on reflow
Diffstat (limited to '')
-rw-r--r--ui.c7
1 files changed, 6 insertions, 1 deletions
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;
 		}