diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-10-07 14:28:13 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-10-07 14:28:13 +0000 |
| commit | 868a2f8107ef46f22e2e1276fcc8302c2ad1c7ed (patch) | |
| tree | ba25f93758e0f0c98d26aa13b7635f9384b548af /src | |
| parent | 10106e8c8e5cd6a5bd52c2068e3dd06d353a66b8 (diff) | |
ncurses: fix color support
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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<std::pair<Color, Color>, 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<Color, Color> colorpair(fg_color, bg_color); auto it = colorpairs.find(colorpair); if (it != colorpairs.end()) |
