summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-17 11:57:29 -0500
committerJune McEnroe <june@causal.agency>2020-02-17 11:57:29 -0500
commitcf83e95114eafc1fc357c68cfedc661482992ac1 (patch)
tree1c12fd321c0e288aeae25ab0dbf71567654a86e2
parentScroll the window only once during reflow (diff)
downloadcatgirl-cf83e95114eafc1fc357c68cfedc661482992ac1.tar.gz
catgirl-cf83e95114eafc1fc357c68cfedc661482992ac1.zip
Only scroll after reflow if necessary
If we've already filled up every line of the window, there is no need to
scroll.
-rw-r--r--ui.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index 938eda6..84a0d9c 100644
--- a/ui.c
+++ b/ui.c
@@ -634,8 +634,10 @@ static void reflow(struct Window *window) {
 		}
 		flowed += lines;
 	}
-	wscrl(window->pad, -(WindowLines - 1 - flowed));
-	wmove(window->pad, WindowLines - 1, RIGHT);
+	if (flowed < WindowLines) {
+		wscrl(window->pad, -(WindowLines - 1 - flowed));
+		wmove(window->pad, WindowLines - 1, RIGHT);
+	}
 }
 
 static void resize(void) {
ogheader'>2018-09-19Fix README mandoc lintsJune McEnroe 2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe 2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe 2018-09-17Add tRNS support to pngoJune McEnroe 2018-09-11Move gfx man pages to gfx/manJune McEnroe 2018-09-11Move bin man pages to bin/manJune McEnroe 2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe 2018-09-11Remove GAMES from BINSJune McEnroe 2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe 2018-09-11Add "blank" lines to man pagesJune McEnroe 2018-09-10Add mdoc syntax fileJune McEnroe 2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe 2018-09-08Put real dates on man pagesJune McEnroe 2018-09-08Replace gfx README with REAMDE.7June McEnroe 2018-09-08Link gfx man pages in ~/.localJune McEnroe