a few more miscellaneous color fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2868 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-07-15 00:36:49 +00:00
parent a74f2f8618
commit 538dc352c5
2 changed files with 7 additions and 5 deletions

View File

@ -64,11 +64,12 @@ void set_colorpairs(void)
} }
} }
/* Initialize the color information. */
void color_init(void) void color_init(void)
{ {
assert(openfile != NULL); assert(openfile != NULL);
if (has_colors()) { if (has_colors() && can_change_color()) {
const colortype *tmpcolor; const colortype *tmpcolor;
#ifdef HAVE_USE_DEFAULT_COLORS #ifdef HAVE_USE_DEFAULT_COLORS
bool defok; bool defok;

View File

@ -220,8 +220,8 @@ void open_buffer(const char *filename)
openfile->current = openfile->fileage; openfile->current = openfile->fileage;
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
/* If we're loading into a new buffer, update the buffer's /* If we're loading into a new buffer, update the colors to account
* associated colors, if applicable. */ * for it, if applicable. */
if (new_buffer) if (new_buffer)
color_update(); color_update();
#endif #endif
@ -234,8 +234,9 @@ void display_buffer(void)
titlebar(NULL); titlebar(NULL);
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
/* Update the buffer's associated colors, if applicable. */ /* Make sure we're using the buffer's associated colors, if
color_update(); * applicable. */
color_init();
#endif #endif
/* Update the edit window. */ /* Update the edit window. */