tweaks: rename two variables, for preciseness and shortness
Also remove an unneeded nulling.master
parent
64366d9992
commit
704a7d7b4f
19
src/color.c
19
src/color.c
|
@ -57,16 +57,16 @@ void set_colorpairs(void)
|
||||||
|
|
||||||
/* Initialize the color pairs for nano's interface elements. */
|
/* Initialize the color pairs for nano's interface elements. */
|
||||||
for (i = 0; i < NUMBER_OF_ELEMENTS; i++) {
|
for (i = 0; i < NUMBER_OF_ELEMENTS; i++) {
|
||||||
colortype *color = specified_color_combo[i];
|
colortype *combo = color_combo[i];
|
||||||
|
|
||||||
if (color != NULL) {
|
if (combo != NULL) {
|
||||||
if (color->fg == -1 && !using_defaults)
|
if (combo->fg == -1 && !using_defaults)
|
||||||
color->fg = COLOR_WHITE;
|
combo->fg = COLOR_WHITE;
|
||||||
if (color->bg == -1 && !using_defaults)
|
if (combo->bg == -1 && !using_defaults)
|
||||||
color->bg = COLOR_BLACK;
|
combo->bg = COLOR_BLACK;
|
||||||
init_pair(i + 1, color->fg, color->bg);
|
init_pair(i + 1, combo->fg, combo->bg);
|
||||||
interface_color_pair[i] = COLOR_PAIR(i + 1) | A_BANDAID |
|
interface_color_pair[i] = COLOR_PAIR(i + 1) | A_BANDAID |
|
||||||
(color->bright ? A_BOLD : A_NORMAL);
|
(combo->bright ? A_BOLD : A_NORMAL);
|
||||||
} else {
|
} else {
|
||||||
if (i != FUNCTION_TAG)
|
if (i != FUNCTION_TAG)
|
||||||
interface_color_pair[i] = hilite_attribute;
|
interface_color_pair[i] = hilite_attribute;
|
||||||
|
@ -74,8 +74,7 @@ void set_colorpairs(void)
|
||||||
interface_color_pair[i] = A_NORMAL;
|
interface_color_pair[i] = A_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(specified_color_combo[i]);
|
free(color_combo[i]);
|
||||||
specified_color_combo[i] = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For each syntax, go through its list of colors and assign each
|
/* For each syntax, go through its list of colors and assign each
|
||||||
|
|
|
@ -233,8 +233,8 @@ regmatch_t regmatches[10];
|
||||||
int hilite_attribute = A_REVERSE;
|
int hilite_attribute = A_REVERSE;
|
||||||
/* The curses attribute we use to highlight something. */
|
/* The curses attribute we use to highlight something. */
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
colortype* specified_color_combo[] = {NULL};
|
colortype* color_combo[] = {NULL};
|
||||||
/* The color combinations as specified in the rcfile. */
|
/* The color combinations for interface elements given in the rcfile. */
|
||||||
#endif
|
#endif
|
||||||
int interface_color_pair[] = {0};
|
int interface_color_pair[] = {0};
|
||||||
/* The processed color pairs for the interface elements. */
|
/* The processed color pairs for the interface elements. */
|
||||||
|
|
|
@ -172,7 +172,7 @@ extern regmatch_t regmatches[10];
|
||||||
|
|
||||||
extern int hilite_attribute;
|
extern int hilite_attribute;
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
extern colortype* specified_color_combo[NUMBER_OF_ELEMENTS];
|
extern colortype *color_combo[NUMBER_OF_ELEMENTS];
|
||||||
#endif
|
#endif
|
||||||
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
|
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
|
||||||
|
|
||||||
|
|
12
src/rcfile.c
12
src/rcfile.c
|
@ -1098,17 +1098,17 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
||||||
|
|
||||||
#ifdef ENABLE_COLOR
|
#ifdef ENABLE_COLOR
|
||||||
if (strcasecmp(rcopts[i].name, "titlecolor") == 0)
|
if (strcasecmp(rcopts[i].name, "titlecolor") == 0)
|
||||||
specified_color_combo[TITLE_BAR] = parse_interface_color(option);
|
color_combo[TITLE_BAR] = parse_interface_color(option);
|
||||||
else if (strcasecmp(rcopts[i].name, "numbercolor") == 0)
|
else if (strcasecmp(rcopts[i].name, "numbercolor") == 0)
|
||||||
specified_color_combo[LINE_NUMBER] = parse_interface_color(option);
|
color_combo[LINE_NUMBER] = parse_interface_color(option);
|
||||||
else if (strcasecmp(rcopts[i].name, "selectedcolor") == 0)
|
else if (strcasecmp(rcopts[i].name, "selectedcolor") == 0)
|
||||||
specified_color_combo[SELECTED_TEXT] = parse_interface_color(option);
|
color_combo[SELECTED_TEXT] = parse_interface_color(option);
|
||||||
else if (strcasecmp(rcopts[i].name, "statuscolor") == 0)
|
else if (strcasecmp(rcopts[i].name, "statuscolor") == 0)
|
||||||
specified_color_combo[STATUS_BAR] = parse_interface_color(option);
|
color_combo[STATUS_BAR] = parse_interface_color(option);
|
||||||
else if (strcasecmp(rcopts[i].name, "keycolor") == 0)
|
else if (strcasecmp(rcopts[i].name, "keycolor") == 0)
|
||||||
specified_color_combo[KEY_COMBO] = parse_interface_color(option);
|
color_combo[KEY_COMBO] = parse_interface_color(option);
|
||||||
else if (strcasecmp(rcopts[i].name, "functioncolor") == 0)
|
else if (strcasecmp(rcopts[i].name, "functioncolor") == 0)
|
||||||
specified_color_combo[FUNCTION_TAG] = parse_interface_color(option);
|
color_combo[FUNCTION_TAG] = parse_interface_color(option);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_OPERATINGDIR
|
#ifdef ENABLE_OPERATINGDIR
|
||||||
|
|
Loading…
Reference in New Issue