ref highlighter tolerates unexisting reference
This commit is contained in:
parent
ca93ae807d
commit
4c942c4a3a
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user