From 4c942c4a3a4b235f8d02a7bc0fd7cbd8a1f3eea0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 10 Jun 2014 22:02:08 +0100 Subject: [PATCH] ref highlighter tolerates unexisting reference --- src/highlighters.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index f44c40a0..cfb887cf 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -652,11 +652,19 @@ HighlighterAndId reference_factory(HighlighterParameters params) const String& name = params[0]; // throw if not found - DefinedHighlighters::instance().get_group(name, '/'); + //DefinedHighlighters::instance().get_group(name, '/'); return HighlighterAndId(name, [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