From 2a2e2be0c43023d8593e00ea07b1fc0596a27a49 Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Mon, 8 Jan 2001 01:32:58 +0000
Subject: [PATCH] Added and fixed bug #50

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@458 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 BUGS   | 3 +++
 move.c | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/BUGS b/BUGS
index b3351763..f8a25fbb 100644
--- a/BUGS
+++ b/BUGS
@@ -81,6 +81,9 @@
 - In certain terminals, nano would not work properly with keypad().
   Turned out to be the silly timeout(0) call which is completely
   unneeded anyway.  (49) [FIXED]
+- With less than a page of text, doing a page down will move the
+  current line to the top of the screen, which it shouldn't do.  (50) 
+  [FIXED]
 
 ** Open BUGS **
 
diff --git a/move.c b/move.c
index 370a1094..f73e838e 100644
--- a/move.c
+++ b/move.c
@@ -55,7 +55,12 @@ int page_down(void)
     if (current == filebot)
 	return 0;
 
-    if (editbot != filebot || edittop == fileage) {
+    /* AHEM, if we only have a screen or less of text, DONT do an
+	edit_update, just move the cursor to editbot! */
+    if (edittop == fileage && editbot == filebot) {
+	current = editbot;
+	reset_cursor();
+    } else if (editbot != filebot || edittop == fileage) {
 	current_y = 0;
 	current = editbot;
 
-- 
GitLab