summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui.c b/ui.c
index bcb1003..938eda6 100644
--- a/ui.c
+++ b/ui.c
@@ -621,18 +621,21 @@ void uiFormat(
 
 static void reflow(struct Window *window) {
 	werase(window->pad);
-	wmove(window->pad, WindowLines - 1, 0);
+	wmove(window->pad, 0, 0);
+	int flowed = 0;
 	window->unreadLines = 0;
 	for (size_t i = 0; i < BufferCap; ++i) {
 		const char *line = bufferLine(&window->buffer, i);
 		if (!line) continue;
 		waddch(window->pad, '\n');
+		int lines = 1 + wordWrap(window->pad, line);
 		if (i >= (size_t)(BufferCap - window->unreadTotal)) {
-			window->unreadLines += 1 + wordWrap(window->pad, line);
-		} else {
-			wordWrap(window->pad, line);
+			window->unreadLines += lines;
 		}
+		flowed += lines;
 	}
+	wscrl(window->pad, -(WindowLines - 1 - flowed));
+	wmove(window->pad, WindowLines - 1, RIGHT);
 }
 
 static void resize(void) {
mit/ui-shared.c?id=bb3cc0d9666553608b7c89aef84d21d3312ce488&follow=1'>ui-shared: do not allow negative minutesJason A. Donenfeld 2014-01-17auth: document tweakables in lua scriptJason A. Donenfeld 2014-01-17repolist: make owner clickable to searchJason A. Donenfeld 2014-01-17ui-shared: move about tab all the way to the leftJason A. Donenfeld 2014-01-17filter: don't forget to reap the auth filterJason A. Donenfeld 2014-01-17cgit.c: free tmp variableJason A. Donenfeld 2014-01-17Switch to exclusively using global ctxLukas Fleischer 2014-01-16auth: have cgit calculate login addressJason A. Donenfeld 2014-01-16auth: lua string comparisons are time invariantJason A. Donenfeld 2014-01-16authentication: use hidden form instead of refererJason A. Donenfeld 2014-01-16auth: add basic authentication filter frameworkJason A. Donenfeld 2014-01-16t0111: Additions and fixesLukas Fleischer 2014-01-16parsing.c: Remove leading space from committerLukas Fleischer