From 868a2f8107ef46f22e2e1276fcc8302c2ad1c7ed Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 7 Oct 2011 14:28:13 +0000 Subject: [PATCH] ncurses: fix color support --- src/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index d190fbe6..c09058f1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -47,11 +47,14 @@ void set_color(Color fg_color, Color bg_color) { static std::map, int> colorpairs; static int current_pair = -1; - static int next_pair = 0; + static int next_pair = 1; if (current_pair != -1) attroff(COLOR_PAIR(current_pair)); + if (fg_color == Color::Default and bg_color == Color::Default) + return; + std::pair colorpair(fg_color, bg_color); auto it = colorpairs.find(colorpair); if (it != colorpairs.end())