startup: move the initialization of colors, so any error gets printed

Suggested-by: Brand Huntsman <alpha@qzx.com>
This commit is contained in:
Benno Schulenberg 2018-01-12 10:48:13 +01:00
parent c1bb6485de
commit 898c4c6fbb
1 changed files with 11 additions and 11 deletions

View File

@ -2473,6 +2473,17 @@ int main(int argc, char **argv)
if (initscr() == NULL) if (initscr() == NULL)
exit(1); exit(1);
#ifdef ENABLE_COLOR
set_colorpairs();
#else
interface_color_pair[TITLE_BAR] = hilite_attribute;
interface_color_pair[LINE_NUMBER] = hilite_attribute;
interface_color_pair[SELECTED_TEXT] = hilite_attribute;
interface_color_pair[STATUS_BAR] = hilite_attribute;
interface_color_pair[KEY_COMBO] = hilite_attribute;
interface_color_pair[FUNCTION_TAG] = A_NORMAL;
#endif
/* Set up the terminal state. */ /* Set up the terminal state. */
terminal_init(); terminal_init();
@ -2494,17 +2505,6 @@ int main(int argc, char **argv)
mouse_init(); mouse_init();
#endif #endif
#ifdef ENABLE_COLOR
set_colorpairs();
#else
interface_color_pair[TITLE_BAR] = hilite_attribute;
interface_color_pair[LINE_NUMBER] = hilite_attribute;
interface_color_pair[SELECTED_TEXT] = hilite_attribute;
interface_color_pair[STATUS_BAR] = hilite_attribute;
interface_color_pair[KEY_COMBO] = hilite_attribute;
interface_color_pair[FUNCTION_TAG] = A_NORMAL;
#endif
/* Ask ncurses for the key codes for Control+Left/Right/Up/Down. */ /* Ask ncurses for the key codes for Control+Left/Right/Up/Down. */
controlleft = get_keycode("kLFT5", CONTROL_LEFT); controlleft = get_keycode("kLFT5", CONTROL_LEFT);
controlright = get_keycode("kRIT5", CONTROL_RIGHT); controlright = get_keycode("kRIT5", CONTROL_RIGHT);