From 3e1bb777ce9c8de3dbe55dee4e454241eddc98d1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 4 Nov 2013 21:53:10 +0000 Subject: Add automatic completion display in prompt mode Controlled by the autoshowcompl option Completers now take a CompletionFlag parameter, used to specify we want fast completion (tag completion can be slow, we do not want to run it if not explicitely wanted by the user). --- src/command_manager.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/command_manager.hh') diff --git a/src/command_manager.hh b/src/command_manager.hh index 9aee1e0c..849ea3a7 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -18,6 +18,7 @@ struct Context; using CommandParameters = memoryview; using Command = std::function; using CommandCompleter = std::function; @@ -25,6 +26,7 @@ class PerArgumentCommandCompleter { public: using ArgumentCompleter = std::function; using ArgumentCompleterList = memoryview; @@ -32,6 +34,7 @@ public: : 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; @@ -47,7 +50,7 @@ public: memoryview shell_params = {}, const EnvVarMap& env_vars = EnvVarMap{}); - Completions complete(const Context& context, + Completions complete(const Context& context, CompletionFlags flags, const String& command_line, ByteCount cursor_pos); bool command_defined(const String& command_name) const; -- cgit v1.2.3