diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-11-04 21:53:10 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-11-04 21:59:28 +0000 |
| commit | 3e1bb777ce9c8de3dbe55dee4e454241eddc98d1 (patch) | |
| tree | 0b6635de8461910e2a6d90e3a14f48c2e5091e36 /src/completion.hh | |
| parent | 70e94cb00a577c53b77f7349f138d3a563745793 (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/completion.hh')
| -rw-r--r-- | src/completion.hh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/completion.hh b/src/completion.hh index c833e2b4..bd89ea4c 100644 --- a/src/completion.hh +++ b/src/completion.hh @@ -26,10 +26,15 @@ struct Completions : start(start), end(end) {} }; -typedef std::function<Completions (const Context&, - const String&, ByteCount)> Completer; +enum class CompletionFlags +{ + None, + Fast +}; +using Completer = std::function<Completions (const Context&, CompletionFlags, + const String&, ByteCount)>; -inline Completions complete_nothing(const Context& context, +inline Completions complete_nothing(const Context& context, CompletionFlags, const String&, ByteCount cursor_pos) { return Completions(cursor_pos, cursor_pos); |
