Browse Source

Don't modify bottom if there is less then a page

Jochen Sprickerhof 5 năm trước cách đây
mục cha
commit
38a8477973
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      scroll.c

+ 2 - 1
scroll.c

@@ -248,6 +248,7 @@ void
 scrollup(void)
 {
 	int rows = 0, start = 0;
+	struct line *bottom_old = bottom;
 
 	/* account for last line */
 	if(bottom != NULL && TAILQ_PREV(bottom, tailhead, entries) == NULL)
@@ -260,7 +261,7 @@ scrollup(void)
 		bottom = TAILQ_NEXT(bottom, entries);
 
 	if (rows <= ws.ws_row) {
-		bottom = TAILQ_LAST(&head, tailhead);
+		bottom = bottom_old;
 		return;
 	}