tweaks: delete some unneeded code, and rename the function accordingly

When set_colorpairs() is called, no files have been loaded yet, so
no syntaxes will have been loaded yet either.  Thus it is pointless
to run through the list of available syntaxes.
This commit is contained in:
Benno Schulenberg 2020-04-28 16:43:11 +02:00
parent 382ec84248
commit d1e1438ca0
3 changed files with 4 additions and 10 deletions

View File

@ -61,9 +61,8 @@ void set_syntax_colorpairs(syntaxtype *sntx)
}
}
/* Initialize the colors for nano's interface, and assign pair numbers
* for the colors in each loaded syntax. */
void set_colorpairs(void)
/* Initialize the color pairs for nano's interface. */
void set_interface_colorpairs(void)
{
bool using_defaults = FALSE;
@ -102,11 +101,6 @@ void set_colorpairs(void)
free(color_combo[index]);
}
/* For each loaded syntax, assign pair numbers to color combinations. */
for (syntaxtype *sntx = syntaxes; sntx != NULL; sntx = sntx->next)
if (sntx->filename == NULL)
set_syntax_colorpairs(sntx);
}
/* Initialize the color pairs for the current syntax. */

View File

@ -2254,7 +2254,7 @@ int main(int argc, char **argv)
started_curses = TRUE;
#ifdef ENABLE_COLOR
set_colorpairs();
set_interface_colorpairs();
#else
interface_color_pair[TITLE_BAR] = hilite_attribute;
interface_color_pair[LINE_NUMBER] = hilite_attribute;

View File

@ -242,7 +242,7 @@ bool is_valid_unicode(wchar_t wc);
/* Most functions in color.c. */
#ifdef ENABLE_COLOR
void set_colorpairs(void);
void set_interface_colorpairs(void);
void prepare_palette(void);
void find_and_prime_applicable_syntax(void);
void set_up_multicache(linestruct *line);