From 669048f4583c471d436ecee090881ed85a7812a4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 8 Aug 2020 11:19:02 +1000 Subject: [PATCH] Rename DefinedHighlighters to SharedHighlighters Matches the user facing name and seems more correct. --- src/commands.cc | 4 ++-- src/highlighter_group.hh | 6 +++--- src/highlighters.cc | 4 ++-- src/main.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index 84ff8011..1e421aa4 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -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(&DefinedHighlighters::instance()) + auto* root = (scope == "shared") ? static_cast(&SharedHighlighters::instance()) : static_cast(&get_scope(scope, context).highlighters().group()); if (sep_it != path.end()) return root->get_child(StringView{sep_it+1, path.end()}); diff --git a/src/highlighter_group.hh b/src/highlighter_group.hh index f3727e58..a0873dc0 100644 --- a/src/highlighter_group.hh +++ b/src/highlighter_group.hh @@ -57,10 +57,10 @@ private: HighlighterGroup m_group; }; -struct DefinedHighlighters : public HighlighterGroup, - public Singleton +struct SharedHighlighters : public HighlighterGroup, + public Singleton { - DefinedHighlighters() : HighlighterGroup{HighlightPass::All} {} + SharedHighlighters() : HighlighterGroup{HighlightPass::All} {} }; } diff --git a/src/highlighters.cc b/src/highlighters.cc index e2991450..78099b08 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -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&) {} diff --git a/src/main.cc b/src/main.cc index 4181b602..76fa64ec 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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;