diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-06-18 20:33:23 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-06-18 20:33:23 +0100 |
| commit | 6f2569ff30aecad1320b405249baed4bb1c1b6df (patch) | |
| tree | f76fad78414794bb25900db3681a478ff9c5f04f /src | |
| parent | 54590f5d79027bcab96b5958b13828a248db2ab1 (diff) | |
Color Default now means 'keep as is' for most highlighters
Diffstat (limited to 'src')
| -rw-r--r-- | src/highlighters.cc | 7 |
1 files changed, 6 insertions, 1 deletions
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<size_t, const ColorPair*>; |
