diff --git a/src/highlighters.cc b/src/highlighters.cc index c0cd686f..3f267d53 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -53,7 +53,7 @@ void highlight_range(DisplayBuffer& display_buffer, } } -typedef std::unordered_map> ColorSpec; +typedef std::unordered_map ColorSpec; class RegexColorizer { @@ -77,8 +77,8 @@ public: highlight_range(display_buffer, match[n].first, match[n].second, true, [&](DisplayAtom& atom) { - atom.fg_color = col_it->second.first; - atom.bg_color = col_it->second.second; + atom.fg_color = col_it->second->first; + atom.bg_color = col_it->second->second; }); } } @@ -132,8 +132,8 @@ HighlighterAndId colorize_regex_factory(Window& window, "' expected :[,]"); int capture = str_to_int(String(res[1].first, res[1].second)); - ColorPair& color = colors[capture]; - color = ColorRegistry::instance()[String(res[2].first, res[2].second)]; + const ColorPair*& color = colors[capture]; + color = &ColorRegistry::instance()[String(res[2].first, res[2].second)]; } String id = "colre'" + params[0] + "'";