tweaks: reshuffle a statement, to have major initialization in nano.c

master
Benno Schulenberg 2020-06-11 16:48:52 +02:00
parent 8535b3db4c
commit b535714671
2 changed files with 5 additions and 6 deletions

View File

@ -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);

View File

@ -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;