Rename DefinedHighlighters to SharedHighlighters

Matches the user facing name and seems more correct.
This commit is contained in:
Maxime Coste 2020-08-08 11:19:02 +10:00
parent 5aa657b150
commit 669048f458
4 changed files with 8 additions and 8 deletions

View File

@ -864,7 +864,7 @@ Completions highlighter_cmd_completer(
StringView scope{path.begin(), sep_it};
HighlighterGroup* root = nullptr;
if (scope == "shared")
root = &DefinedHighlighters::instance();
root = &SharedHighlighters::instance();
else if (auto* s = get_scope_ifp(scope, context))
root = &s->highlighters().group();
else
@ -889,7 +889,7 @@ Highlighter& get_highlighter(const Context& context, StringView path)
auto sep_it = find(path, '/');
StringView scope{path.begin(), sep_it};
auto* root = (scope == "shared") ? static_cast<HighlighterGroup*>(&DefinedHighlighters::instance())
auto* root = (scope == "shared") ? static_cast<HighlighterGroup*>(&SharedHighlighters::instance())
: static_cast<HighlighterGroup*>(&get_scope(scope, context).highlighters().group());
if (sep_it != path.end())
return root->get_child(StringView{sep_it+1, path.end()});

View File

@ -57,10 +57,10 @@ private:
HighlighterGroup m_group;
};
struct DefinedHighlighters : public HighlighterGroup,
public Singleton<DefinedHighlighters>
struct SharedHighlighters : public HighlighterGroup,
public Singleton<SharedHighlighters>
{
DefinedHighlighters() : HighlighterGroup{HighlightPass::All} {}
SharedHighlighters() : HighlighterGroup{HighlightPass::All} {}
};
}

View File

@ -1695,7 +1695,7 @@ private:
try
{
DefinedHighlighters::instance().get_child(m_name).highlight(context, display_buffer, range);
SharedHighlighters::instance().get_child(m_name).highlight(context, display_buffer, range);
}
catch (child_not_found&)
{}
@ -1705,7 +1705,7 @@ private:
{
try
{
DefinedHighlighters::instance().get_child(m_name).compute_display_setup(context, setup);
SharedHighlighters::instance().get_child(m_name).compute_display_setup(context, setup);
}
catch (child_not_found&)
{}

View File

@ -752,7 +752,7 @@ int run_server(StringView session, StringView server_init,
CommandManager command_manager;
RegisterManager register_manager;
HighlighterRegistry highlighter_registry;
DefinedHighlighters defined_highlighters;
SharedHighlighters defined_highlighters;
ClientManager client_manager;
BufferManager buffer_manager;