diff --git a/src/move.c b/src/move.c
index 92044f41f2aca1e452a2766a6e89f7b41ab1df0a..eb80157c690f34f1dc234192129c9ee3aeb85e34 100644
--- a/src/move.c
+++ b/src/move.c
@@ -529,20 +529,22 @@ void do_scroll_up(void)
 	if (openfile->edittop->prev == NULL && openfile->firstcolumn == 0)
 		return;
 
-	edit_scroll(BACKWARD);
-
 	if (openfile->current_y == editwinrows - 1)
 		do_up();
+
+	edit_scroll(BACKWARD);
 }
 
 /* Scroll down one line or chunk without scrolling the cursor. */
 void do_scroll_down(void)
 {
-	if (openfile->current->next != NULL || openfile->current_y > 0)
-		edit_scroll(FORWARD);
-
 	if (openfile->current_y == 0)
 		do_down();
+
+	if (openfile->edittop->next != NULL ||
+					chunk_for(openfile->firstcolumn, openfile->edittop) <
+					number_of_chunks_in(openfile->edittop))
+		edit_scroll(FORWARD);
 }
 #endif