소스 검색

Simplify scrollback logic

Jochen Sprickerhof 6 년 전
부모
커밋
deee4c0f1c
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  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;
 	}