commit b535714671fe24a59ce4b826125daa10f001dc2d
parent 8535b3db4ca206d988cdd83d19ba1dec5674a2bd
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 11 Jun 2020 16:48:52 +0200
tweaks: reshuffle a statement, to have major initialization in nano.c
Diffstat:
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/color.c b/src/color.c
@@ -66,9 +66,6 @@ void set_interface_colorpairs(void)
{
bool using_defaults = FALSE;
- /* Tell ncurses to enable colors. */
- start_color();
-
#ifdef HAVE_USE_DEFAULT_COLORS
/* Allow using the default colors, if available. */
using_defaults = (use_default_colors() != ERR);
diff --git a/src/nano.c b/src/nano.c
@@ -2271,10 +2271,12 @@ int main(int argc, char **argv)
started_curses = TRUE;
#ifdef ENABLE_COLOR
- /* On capable terminals, use colors, otherwise use just reverse or bold.*/
- if (has_colors())
+ /* If the terminal can do colors, tell ncurses to switch them on, and
+ * initialize the interface ones. Otherwise just use reverse or bold.*/
+ if (has_colors()) {
+ start_color();
set_interface_colorpairs();
- else
+ } else
#endif
{
interface_color_pair[TITLE_BAR] = hilite_attribute;