Rename id_map to IdMap
This commit is contained in:
parent
fb611e2f62
commit
b0fef1a962
|
@ -67,7 +67,7 @@ std::unique_ptr<SimpleHighlighter<T>> make_simple_highlighter(T func)
|
||||||
using HighlighterParameters = memoryview<String>;
|
using HighlighterParameters = memoryview<String>;
|
||||||
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
|
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
|
||||||
|
|
||||||
struct HighlighterRegistry : id_map<HighlighterFactory>,
|
struct HighlighterRegistry : IdMap<HighlighterFactory>,
|
||||||
Singleton<HighlighterRegistry>
|
Singleton<HighlighterRegistry>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
Completions complete_child(StringView path, ByteCount cursor_pos, bool group) const override;
|
Completions complete_child(StringView path, ByteCount cursor_pos, bool group) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using HighlighterMap = id_map<std::unique_ptr<Highlighter>>;
|
using HighlighterMap = IdMap<std::unique_ptr<Highlighter>>;
|
||||||
HighlighterMap m_highlighters;
|
HighlighterMap m_highlighters;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -958,7 +958,7 @@ public:
|
||||||
return offset_pos(hl.complete_child(path.substr(offset), cursor_pos - offset, group), offset);
|
return offset_pos(hl.complete_child(path.substr(offset), cursor_pos - offset, group), offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto container = transformed(m_groups, id_map<HighlighterGroup>::get_id);
|
auto container = transformed(m_groups, IdMap<HighlighterGroup>::get_id);
|
||||||
return { 0, 0, complete(path, cursor_pos, container) };
|
return { 0, 0, complete(path, cursor_pos, container) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1005,7 +1005,7 @@ public:
|
||||||
private:
|
private:
|
||||||
const NamedRegionDescList m_regions;
|
const NamedRegionDescList m_regions;
|
||||||
const String m_default_group;
|
const String m_default_group;
|
||||||
id_map<HighlighterGroup> m_groups;
|
IdMap<HighlighterGroup> m_groups;
|
||||||
|
|
||||||
struct Region
|
struct Region
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ CandidateList HookManager::complete_hook_group(StringView prefix, ByteCount pos_
|
||||||
CandidateList res;
|
CandidateList res;
|
||||||
for (auto& list : m_hook)
|
for (auto& list : m_hook)
|
||||||
{
|
{
|
||||||
auto container = transformed(list.second, id_map<HookFunc>::get_id);
|
auto container = transformed(list.second, IdMap<HookFunc>::get_id);
|
||||||
for (auto& c : complete(prefix, pos_in_token, container))
|
for (auto& c : complete(prefix, pos_in_token, container))
|
||||||
{
|
{
|
||||||
if (!contains(res, c))
|
if (!contains(res, c))
|
||||||
|
|
|
@ -29,7 +29,7 @@ private:
|
||||||
friend class Scope;
|
friend class Scope;
|
||||||
|
|
||||||
HookManager* m_parent;
|
HookManager* m_parent;
|
||||||
UnorderedMap<String, id_map<HookFunc>> m_hook;
|
UnorderedMap<String, IdMap<HookFunc>> m_hook;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
template<typename Value>
|
template<typename Value>
|
||||||
class id_map
|
class IdMap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using value_type = std::pair<String, Value>;
|
using value_type = std::pair<String, Value>;
|
||||||
|
@ -18,8 +18,8 @@ public:
|
||||||
using iterator = typename container_type::iterator;
|
using iterator = typename container_type::iterator;
|
||||||
using const_iterator = typename container_type::const_iterator;
|
using const_iterator = typename container_type::const_iterator;
|
||||||
|
|
||||||
id_map() = default;
|
IdMap() = default;
|
||||||
id_map(std::initializer_list<value_type> val) : m_content{val} {}
|
IdMap(std::initializer_list<value_type> val) : m_content{val} {}
|
||||||
|
|
||||||
void append(const value_type& value)
|
void append(const value_type& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct SwitchDesc
|
||||||
String description;
|
String description;
|
||||||
};
|
};
|
||||||
|
|
||||||
using SwitchMap = id_map<SwitchDesc>;
|
using SwitchMap = IdMap<SwitchDesc>;
|
||||||
|
|
||||||
String generate_switches_doc(const SwitchMap& opts);
|
String generate_switches_doc(const SwitchMap& opts);
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ Register& RegisterManager::operator[](StringView reg)
|
||||||
if (reg.length() == 1)
|
if (reg.length() == 1)
|
||||||
return (*this)[reg[0]];
|
return (*this)[reg[0]];
|
||||||
|
|
||||||
static const id_map<Codepoint> reg_names = {
|
static const IdMap<Codepoint> reg_names = {
|
||||||
{ "slash", '/' },
|
{ "slash", '/' },
|
||||||
{ "dquote", '"' },
|
{ "dquote", '"' },
|
||||||
{ "pipe", '|' }
|
{ "pipe", '|' }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user