summaryrefslogtreecommitdiff
path: root/src/completion.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-11-18 22:17:50 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-11-18 22:17:50 +0000
commitd27548dd154631ce627dfeb8abbf0a8540e73366 (patch)
treeb027c55ca0d9608e6fbad7ab2915e9684f7d8bc6 /src/completion.hh
parentf57f065d7618999bbdd9f92439550d90fd9b5adc (diff)
Resurect idvaluemap, order of traversal matters
This reverts commit 2b9b161d424c1168636042adc6678bb3df2be3f9.
Diffstat (limited to 'src/completion.hh')
-rw-r--r--src/completion.hh30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/completion.hh b/src/completion.hh
index eb1d4fa6..44726dd3 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -5,7 +5,6 @@
#include <vector>
#include <functional>
-#include <unordered_map>
namespace Kakoune
{
@@ -41,34 +40,5 @@ inline Completions complete_nothing(const Context& context, CompletionFlags,
return Completions(cursor_pos, cursor_pos);
}
-template<typename Condition, typename Value>
-CandidateList complete_key_if(const std::unordered_map<String, Value>& map,
- const String& prefix,
- ByteCount cursor_pos,
- Condition condition)
-{
- String real_prefix = prefix.substr(0, cursor_pos);
- CandidateList result;
- for (auto& value : map)
- {
- if (not condition(value))
- continue;
-
- if (prefix_match(value.first, real_prefix))
- result.push_back(value.first);
- }
- return result;
-}
-
-template<typename Value>
-CandidateList complete_key(const std::unordered_map<String, Value>& map,
- const String& prefix,
- ByteCount cursor_pos)
-{
- return complete_key_if(
- map, prefix, cursor_pos,
- [](const std::pair<String, Value>&) { return true; });
-}
-
}
#endif // completion_hh_INCLUDED