ref highlighter tolerates unexisting reference

This commit is contained in:
Maxime Coste 2014-06-10 22:02:08 +01:00
parent ca93ae807d
commit 4c942c4a3a

View File

@ -652,11 +652,19 @@ HighlighterAndId reference_factory(HighlighterParameters params)
const String& name = params[0]; const String& name = params[0];
// throw if not found // throw if not found
DefinedHighlighters::instance().get_group(name, '/'); //DefinedHighlighters::instance().get_group(name, '/');
return HighlighterAndId(name, return HighlighterAndId(name,
[name](const Context& context, HighlightFlags flags, DisplayBuffer& display_buffer) [name](const Context& context, HighlightFlags flags, DisplayBuffer& display_buffer)
{ DefinedHighlighters::instance().get_group(name, '/')(context, flags, display_buffer); }); {
try
{
DefinedHighlighters::instance().get_group(name, '/')(context, flags, display_buffer);
}
catch (group_not_found&)
{
}
});
} }
template<typename HighlightFunc> template<typename HighlightFunc>