addhl supports a -group option
-group <group_id> can be used to add the highlighter in a highlighter group which will be then handled as a whole.
This commit is contained in:
parent
98f937146a
commit
f3e8498a58
19
src/main.cc
19
src/main.cc
|
@ -485,9 +485,22 @@ void add_highlighter(const CommandParameters& params, const Context& context)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
HighlighterRegistry& registry = HighlighterRegistry::instance();
|
HighlighterRegistry& registry = HighlighterRegistry::instance();
|
||||||
HighlighterParameters highlighter_params(params.begin()+1, params.end());
|
if (params[0] == "-group")
|
||||||
registry.add_highlighter_to_window(*context.window, params[0],
|
{
|
||||||
highlighter_params);
|
if (params.size() < 3)
|
||||||
|
throw wrong_argument_count();
|
||||||
|
|
||||||
|
HighlighterGroup& group = context.window->get_highlighter_group(params[1]);
|
||||||
|
HighlighterParameters highlighter_params(params.begin()+3, params.end());
|
||||||
|
registry.add_highlighter_to_group(*context.window, group,
|
||||||
|
params[2], highlighter_params);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HighlighterParameters highlighter_params(params.begin()+1, params.end());
|
||||||
|
registry.add_highlighter_to_window(*context.window, params[0],
|
||||||
|
highlighter_params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (runtime_error& err)
|
catch (runtime_error& err)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user