From e5c7e928c92f156c7667c3ba7a2926941a774cbd Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 12 Jul 2005 23:06:22 +0000
Subject: [PATCH] still more breakage fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2852 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  6 +++---
 src/files.c | 17 +++++++++++------
 src/nano.c  |  7 +------
 src/proto.h |  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f9e74481..c035bb96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,9 +15,9 @@ CVS code -
 	  Accordingly, remove the globals.  Changes to pretty much
 	  every function.  Rename global_init() window_size_init(),
 	  rename add_open_file() make_new_buffer(), rename load_buffer()
-	  open_buffer(), rename load_open_file() load_buffer(), rename
-	  open_prevnext_file() switch_to_prevnext_buffer(), rename
-	  open_prevfile_void() switch_to_prev_buffer(), rename
+	  open_buffer(), rename load_open_file() display_buffer(),
+	  rename open_prevnext_file() switch_to_prevnext_buffer(),
+	  rename open_prevfile_void() switch_to_prev_buffer(), rename
 	  open_nextfile_void() switch_to_next_buffer(), rename
 	  write_marked() write_marked_file(), remove load_file(), rename
 	  cancel_fork() cancel_command(), rename open_pipe()
diff --git a/src/files.c b/src/files.c
index 1013cd1f..c99fcfc6 100644
--- a/src/files.c
+++ b/src/files.c
@@ -215,15 +215,20 @@ void open_buffer(const char *filename)
      * to the first line of the buffer. */
     if (rc != -1 && new_buffer)
 	openfile->current = openfile->fileage;
+
+#ifdef ENABLE_COLOR
+    /* If we're loading into a new buffer, update the buffer's
+     * associated colors, if applicable. */
+    if (new_buffer)
+	update_color();
+#endif
+
 }
 
 /* Update the screen to account for the current buffer. */
-void load_buffer(void)
+void display_buffer(void)
 {
 	titlebar(NULL);
-#ifdef ENABLE_COLOR
-	update_color();
-#endif
 	edit_refresh();
 }
 
@@ -250,7 +255,7 @@ void switch_to_prevnext_buffer(bool next_buf)
 #endif
 
     /* Update the screen to account for the current buffer. */
-    load_buffer();
+    display_buffer();
 
     /* Indicate the switch on the statusbar. */
     statusbar(_("Switched to %s"),
@@ -794,7 +799,7 @@ void do_insertfile(
 	    if (ISSET(MULTIBUFFER))
 		/* Update the screen to account for the current
 		 * buffer. */
-		load_buffer();
+		display_buffer();
 	    else
 #endif
 	    {
diff --git a/src/nano.c b/src/nano.c
index c2e31292..3bb685c5 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -4714,17 +4714,12 @@ int main(int argc, char **argv)
 
     display_main_list();
 
-    titlebar(NULL);
-#ifdef ENABLE_COLOR
-    update_color();
-#endif
-
 #ifndef NANO_SMALL
     /* Return here after a SIGWINCH. */
     sigsetjmp(jmpbuf, 1);
 #endif
 
-    edit_refresh();
+    display_buffer();    
 
     while (TRUE) {
 	bool meta_key, func_key, s_or_t, ran_func, finished;
diff --git a/src/proto.h b/src/proto.h
index 189c20ac..2262f1ad 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -243,7 +243,7 @@ void initialize_buffer(void);
 void reinitialize_buffer(void);
 #endif
 void open_buffer(const char *filename);
-void load_buffer(void);
+void display_buffer(void);
 #ifdef ENABLE_MULTIBUFFER
 void switch_to_prevnext_buffer(bool next);
 void switch_to_prev_buffer_void(void);
-- 
GitLab