From da721be17a0add38ca87531995f9eb9a9eea917a Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Mon, 31 Jul 2000 01:26:42 +0000
Subject: [PATCH] Bug fixes for do_enter and do_backspace

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@151 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 BUGS        | 19 +++++++++++++++++++
 ChangeLog   |  5 +++++
 nano.c      |  4 ++--
 po/nano.pot |  2 +-
 proto.h     |  2 +-
 winio.c     |  2 +-
 6 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/BUGS b/BUGS
index e10a34d6..fd1762d4 100644
--- a/BUGS
+++ b/BUGS
@@ -62,3 +62,22 @@
   written out to disk when saved..... (37).
 - Page up and page down do not work the same way as Pico (# of lines). (38)
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ChangeLog b/ChangeLog
index d19f0976..7c6d2fea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,11 @@ CVS code
 	- New function, nulls a string at a given index and realigns it.
   delete_buffer()
 	- Removed, same as free_filestruct().
+  do_backspace()
+	- Now calls page_up_center instead of page_up (as it should?)
+  do_enter()
+	- Fixed typo (?) in check for inptr->next.  Caused lots of
+	  grief for editing lines at filebot.
 - search.c:
   replace_abort()
 	- redundant, now just calls search abort until it does something
diff --git a/nano.c b/nano.c
index af2bef76..f24186ba 100644
--- a/nano.c
+++ b/nano.c
@@ -527,7 +527,7 @@ int do_enter(filestruct * inptr)
     }
     *tmp = 0;
 
-    if (inptr->next != NULL) {
+    if (inptr->next == NULL) {
 	filebot = new;
 	editbot = new;
     }
@@ -956,7 +956,7 @@ int do_backspace(void)
 		current = previous->next;
 	    else
 		current = previous;
-	    page_up();
+	    page_up_center();
 	} else {
 	    if (previous->next)
 		current = previous->next;
diff --git a/po/nano.pot b/po/nano.pot
index 3343a27c..eea666c0 100644
--- a/po/nano.pot
+++ b/po/nano.pot
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-07-29 00:38-0400\n"
+"POT-Creation-Date: 2000-07-30 21:30-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/proto.h b/proto.h
index 203dddf7..39eb39ba 100644
--- a/proto.h
+++ b/proto.h
@@ -110,7 +110,7 @@ void null_at(char *data, int index);
 
 int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
 int do_insertfile(void), do_search(void), page_up(void), page_down(void);
-int do_cursorpos(void), do_spell(void);
+int do_cursorpos(void), do_spell(void), page_up_center(void);
 int do_up(void), do_down (void), do_right(void), do_left (void);
 int do_home(void), do_end(void), total_refresh(void), do_mark(void);
 int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
diff --git a/winio.c b/winio.c
index 1270733e..1a2c0e40 100644
--- a/winio.c
+++ b/winio.c
@@ -840,7 +840,7 @@ void edit_refresh(void)
 	lines++;
     }
     if (!currentcheck) /* Then current has run off the screen... */ 
-	edit_update(current, CENTER);	
+	edit_update(current, CENTER);
 
     if (lines <= editwinrows - 1)
 	while (lines <= editwinrows - 1) {
-- 
GitLab