summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-01-26 16:14:02 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-01-27 19:51:58 +0000
commit37b4eacdc86e04dbca168b430eaedd829dd24ae6 (patch)
treee1aef5914c77a2810541af1f1c7a728f927ec692 /src/command_manager.hh
parent00c1523c6e0d03b5176b5066d44934d3fbe1704d (diff)
Rework command completion to allow partial token completion
Implement hook completion. fixes #44
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh
index 72a4a7f8..78c93dd1 100644
--- a/src/command_manager.hh
+++ b/src/command_manager.hh
@@ -17,10 +17,10 @@ namespace Kakoune
struct Context;
using CommandParameters = memoryview<String>;
using Command = std::function<void (CommandParameters, Context& context)>;
-using CommandCompleter = std::function<CandidateList (const Context& context,
- CompletionFlags,
- CommandParameters,
- size_t, ByteCount)>;
+using CommandCompleter = std::function<Completions (const Context& context,
+ CompletionFlags,
+ CommandParameters,
+ size_t, ByteCount)>;
enum class CommandFlags
{
None = 0,
@@ -38,7 +38,7 @@ constexpr bool operator&(CommandFlags lhs, CommandFlags rhs)
class PerArgumentCommandCompleter
{
public:
- using ArgumentCompleter = std::function<CandidateList (const Context&,
+ using ArgumentCompleter = std::function<Completions (const Context&,
CompletionFlags flags,
const String&, ByteCount)>;
using ArgumentCompleterList = memoryview<ArgumentCompleter>;
@@ -46,11 +46,11 @@ public:
PerArgumentCommandCompleter(ArgumentCompleterList completers)
: m_completers(completers.begin(), completers.end()) {}
- CandidateList operator()(const Context& context,
- CompletionFlags flags,
- CommandParameters params,
- size_t token_to_complete,
- ByteCount pos_in_token) const;
+ Completions operator()(const Context& context,
+ CompletionFlags flags,
+ CommandParameters params,
+ size_t token_to_complete,
+ ByteCount pos_in_token) const;
private:
std::vector<ArgumentCompleter> m_completers;