Color Default now means 'keep as is' for most highlighters

This commit is contained in:
Maxime Coste 2014-06-18 20:33:23 +01:00
parent 54590f5d79
commit 6f2569ff30

View File

@ -151,7 +151,12 @@ void apply_highlighter(const Context& context,
auto apply_colors = [](const ColorPair& colors) auto apply_colors = [](const ColorPair& colors)
{ {
return [&colors](DisplayAtom& atom) { atom.colors = colors; }; return [&colors](DisplayAtom& atom) {
if (colors.first != Colors::Default)
atom.colors.first = colors.first;
if (colors.second != Colors::Default)
atom.colors.second = colors.second;
};
}; };
using ColorSpec = std::unordered_map<size_t, const ColorPair*>; using ColorSpec = std::unordered_map<size_t, const ColorPair*>;