From 538dc352c5a8972688b825017ba3c50e7de4a8de Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 15 Jul 2005 00:36:49 +0000
Subject: [PATCH] a few more miscellaneous color fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2868 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/color.c | 3 ++-
 src/files.c | 9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/color.c b/src/color.c
index 45192093..b1085822 100644
--- a/src/color.c
+++ b/src/color.c
@@ -64,11 +64,12 @@ void set_colorpairs(void)
     }
 }
 
+/* Initialize the color information. */
 void color_init(void)
 {
     assert(openfile != NULL);
 
-    if (has_colors()) {
+    if (has_colors() && can_change_color()) {
 	const colortype *tmpcolor;
 #ifdef HAVE_USE_DEFAULT_COLORS
 	bool defok;
diff --git a/src/files.c b/src/files.c
index 848d2c8d..871e7122 100644
--- a/src/files.c
+++ b/src/files.c
@@ -220,8 +220,8 @@ void open_buffer(const char *filename)
 	openfile->current = openfile->fileage;
 
 #ifdef ENABLE_COLOR
-    /* If we're loading into a new buffer, update the buffer's
-     * associated colors, if applicable. */
+    /* If we're loading into a new buffer, update the colors to account
+     * for it, if applicable. */
     if (new_buffer)
 	color_update();
 #endif
@@ -234,8 +234,9 @@ void display_buffer(void)
     titlebar(NULL);
 
 #ifdef ENABLE_COLOR
-    /* Update the buffer's associated colors, if applicable. */
-    color_update();
+    /* Make sure we're using the buffer's associated colors, if
+     * applicable. */
+    color_init();
 #endif
 
     /* Update the edit window. */
-- 
GitLab