diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-11-18 22:17:50 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-11-18 22:17:50 +0000 |
| commit | d27548dd154631ce627dfeb8abbf0a8540e73366 (patch) | |
| tree | b027c55ca0d9608e6fbad7ab2915e9684f7d8bc6 /src/function_registry.hh | |
| parent | f57f065d7618999bbdd9f92439550d90fd9b5adc (diff) | |
Resurect idvaluemap, order of traversal matters
This reverts commit 2b9b161d424c1168636042adc6678bb3df2be3f9.
Diffstat (limited to 'src/function_registry.hh')
| -rw-r--r-- | src/function_registry.hh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/function_registry.hh b/src/function_registry.hh index 03d8c09d..2197efcc 100644 --- a/src/function_registry.hh +++ b/src/function_registry.hh @@ -2,10 +2,9 @@ #define function_registry_h_INCLUDED #include "completion.hh" +#include "idvaluemap.hh" #include "string.hh" -#include <unordered_map> - namespace Kakoune { @@ -21,8 +20,8 @@ class FunctionRegistry public: void register_func(const String& name, const FunctionType& function) { - kak_assert(m_functions.find(name) == m_functions.end()); - m_functions[name] = function; + kak_assert(not m_functions.contains(name)); + m_functions.append(std::make_pair(name, function)); } const FunctionType& operator[](const String& name) const @@ -35,11 +34,11 @@ public: CandidateList complete_name(const String& prefix, ByteCount cursor_pos) { - return complete_key(m_functions, prefix, cursor_pos); + return m_functions.complete_id(prefix, cursor_pos); } private: - std::unordered_map<String, FunctionType> m_functions; + idvaluemap<String, FunctionType> m_functions; }; } |
