From 6f2569ff30aecad1320b405249baed4bb1c1b6df Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 18 Jun 2014 20:33:23 +0100 Subject: [PATCH] Color Default now means 'keep as is' for most highlighters --- src/highlighters.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index ca078978..b1213b6c 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -151,7 +151,12 @@ void apply_highlighter(const Context& context, 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;