summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-11-04 21:53:10 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-11-04 21:59:28 +0000
commit3e1bb777ce9c8de3dbe55dee4e454241eddc98d1 (patch)
tree0b6635de8461910e2a6d90e3a14f48c2e5091e36 /src/command_manager.hh
parent70e94cb00a577c53b77f7349f138d3a563745793 (diff)
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).
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh5
1 files changed, 4 insertions, 1 deletions
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<String>;
using Command = std::function<void (CommandParameters, Context& context)>;
using CommandCompleter = std::function<CandidateList (const Context& context,
+ CompletionFlags,
CommandParameters,
size_t, ByteCount)>;
@@ -25,6 +26,7 @@ class PerArgumentCommandCompleter
{
public:
using ArgumentCompleter = std::function<CandidateList (const Context&,
+ CompletionFlags flags,
const String&, ByteCount)>;
using ArgumentCompleterList = memoryview<ArgumentCompleter>;
@@ -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<String> 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;