mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-24 10:12:30 +03:00
startup: move the initialization of colors, so any error gets printed
Suggested-by: Brand Huntsman <alpha@qzx.com>
This commit is contained in:
parent
c1bb6485de
commit
898c4c6fbb
22
src/nano.c
22
src/nano.c
@ -2473,6 +2473,17 @@ int main(int argc, char **argv)
|
||||
if (initscr() == NULL)
|
||||
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. */
|
||||
terminal_init();
|
||||
|
||||
@ -2494,17 +2505,6 @@ int main(int argc, char **argv)
|
||||
mouse_init();
|
||||
#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. */
|
||||
controlleft = get_keycode("kLFT5", CONTROL_LEFT);
|
||||
controlright = get_keycode("kRIT5", CONTROL_RIGHT);
|
||||
|
Loading…
Reference in New Issue
Block a user