Bläddra i källkod

Simplify scrollback logic

Jochen Sprickerhof 6 år sedan
förälder
incheckning
deee4c0f1c
1 ändrade filer med 2 tillägg och 4 borttagningar
  1. 2 4
      scroll.c

+ 2 - 4
scroll.c

@@ -207,12 +207,10 @@ scrollup(void)
 	int rows = 0;
 
 	/* wind back bottom pointer by two pages */
-	for (rows = 0; bottom != NULL && rows < 2 * ws.ws_row; rows++)
+	for (; TAILQ_NEXT(bottom, entries) != NULL && rows < 2 * ws.ws_row; rows++)
 		bottom = TAILQ_NEXT(bottom, entries);
-	if (bottom == NULL)
-		bottom = TAILQ_LAST(&head, tailhead);
 
-	if (rows - ws.ws_row < 0) {
+	if (rows < ws.ws_row) {
 		bottom = TAILQ_FIRST(&head);
 		return;
 	}