From f6af18b6a9b74134d29fe05e0dea58a9a65d1808 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sun, 29 Apr 2001 02:25:41 +0000 Subject: [PATCH] page_up() - Rewritten with a loop to make screen updates work when mark is set (fixes bug #59). git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_1_0_branch/nano@617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- BUGS | 2 ++ ChangeLog | 4 ++++ move.c | 13 ++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/BUGS b/BUGS index 4f3acded..1749f619 100644 --- a/BUGS +++ b/BUGS @@ -107,6 +107,8 @@ Matthias Andree) (58) [FIXED]. - Can modify the current file in view mode with ^W^R (discovered by Rocco Corsi) (58) [FIXED]. +- When page up is used after two page down's, the screen doesn't update + properly (discovered by David Lawrence Ramsey) (59) [FIXED]. ** Open BUGS ** diff --git a/ChangeLog b/ChangeLog index fb84f8c6..f711d588 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ Cvs code - - General: - Moved config.h up in all .c files #include list (Albert Chin). +- move.c: + page_up() + - Rewritten with a loop to make screen updates work when + mark is set (fixes bug #59). - nano.c: ABCD(), main() - Add Alt-whatever-[a-d] support as well as Alt-whatever-[A-D]. diff --git a/move.c b/move.c index f7a9efa8..071ea8d6 100644 --- a/move.c +++ b/move.c @@ -146,7 +146,8 @@ void page_up_center(void) int page_up(void) { - filestruct *fileptr = edittop; + int i; + wrap_reset(); current_x = 0; placewewant = 0; @@ -155,13 +156,11 @@ int page_up(void) return 0; current_y = 0; - if (fileptr->next != NULL) - fileptr = fileptr->next; - if (fileptr->next != NULL) - fileptr = fileptr->next; - current = edittop; - edit_update(fileptr, BOTTOM); + for (i = 0; i <= editwinrows - 3 && current->prev != NULL; i++) + current = current->prev; + + edit_update(current, TOP); update_cursor(); UNSET(KEEP_CUTBUFFER); -- 2.39.5