weeding: remove a workaround for early versions of ncurses-6.0
Those versions are more than five years old. If there are still machines with those versions, people should upgrade ncurses too if they want the newest version of nano.master
parent
7f184ee2ba
commit
7d35f71c87
17
src/color.c
17
src/color.c
|
@ -29,15 +29,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* For early versions of ncurses-6.0, use an additional A_PROTECT attribute
|
|
||||||
* for all colors, in order to work around an ncurses miscoloring bug. */
|
|
||||||
#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR == 6) && \
|
|
||||||
(NCURSES_VERSION_MINOR == 0) && (NCURSES_VERSION_PATCH < 20151017)
|
|
||||||
#define A_BANDAID A_PROTECT
|
|
||||||
#else
|
|
||||||
#define A_BANDAID A_NORMAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool defaults_allowed = FALSE;
|
static bool defaults_allowed = FALSE;
|
||||||
/* Whether ncurses accepts -1 to mean "default color". */
|
/* Whether ncurses accepts -1 to mean "default color". */
|
||||||
|
|
||||||
|
@ -61,8 +52,7 @@ void set_interface_colorpairs(void)
|
||||||
combo->bg = COLOR_BLACK;
|
combo->bg = COLOR_BLACK;
|
||||||
}
|
}
|
||||||
init_pair(index + 1, combo->fg, combo->bg);
|
init_pair(index + 1, combo->fg, combo->bg);
|
||||||
interface_color_pair[index] = COLOR_PAIR(index + 1) | A_BANDAID |
|
interface_color_pair[index] = COLOR_PAIR(index + 1) | combo->attributes;
|
||||||
combo->attributes;
|
|
||||||
} else {
|
} else {
|
||||||
if (index == FUNCTION_TAG || index == SCROLL_BAR)
|
if (index == FUNCTION_TAG || index == SCROLL_BAR)
|
||||||
interface_color_pair[index] = A_NORMAL;
|
interface_color_pair[index] = A_NORMAL;
|
||||||
|
@ -70,8 +60,7 @@ void set_interface_colorpairs(void)
|
||||||
interface_color_pair[index] = A_REVERSE;
|
interface_color_pair[index] = A_REVERSE;
|
||||||
else if (index == ERROR_MESSAGE) {
|
else if (index == ERROR_MESSAGE) {
|
||||||
init_pair(index + 1, COLOR_WHITE, COLOR_RED);
|
init_pair(index + 1, COLOR_WHITE, COLOR_RED);
|
||||||
interface_color_pair[index] = COLOR_PAIR(index + 1) |
|
interface_color_pair[index] = COLOR_PAIR(index + 1) | A_BOLD;
|
||||||
A_BOLD | A_BANDAID;
|
|
||||||
} else
|
} else
|
||||||
interface_color_pair[index] = hilite_attribute;
|
interface_color_pair[index] = hilite_attribute;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +91,7 @@ void set_syntax_colorpairs(syntaxtype *sntx)
|
||||||
|
|
||||||
ink->pairnum = (older != ink) ? older->pairnum : ++number;
|
ink->pairnum = (older != ink) ? older->pairnum : ++number;
|
||||||
|
|
||||||
ink->attributes |= COLOR_PAIR(ink->pairnum) | A_BANDAID;
|
ink->attributes |= COLOR_PAIR(ink->pairnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue