diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-10-27 13:33:15 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-10-27 13:33:15 +0000 |
| commit | 2eba789610c71b23dc7a32107ee6350cd810a9cf (patch) | |
| tree | 775be815bf0fd67557d833f64fb65d44d1bbb2b9 /src/command_manager.hh | |
| parent | c77cb7c777ffc6f23ad53003d3531c1957fcdd0b (diff) | |
| parent | 8f7c2ac636369f1f012fe1685ce9c0220fa81645 (diff) | |
Merge branch 'master' into ranked-word-completion
Diffstat (limited to 'src/command_manager.hh')
| -rw-r--r-- | src/command_manager.hh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh index 9592bce6..2251e8b7 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -19,11 +19,15 @@ namespace Kakoune class Context; using CommandParameters = ConstArrayView<String>; -using Command = std::function<void (const ParametersParser& parser, Context& context)>; +using Command = std::function<void (const ParametersParser& parser, + Context& context, + const ShellContext& shell_context)>; + using CommandCompleter = std::function<Completions (const Context& context, CompletionFlags, CommandParameters, size_t, ByteCount)>; + using CommandHelper = std::function<String (const Context& context, CommandParameters)>; enum class CommandFlags @@ -61,8 +65,7 @@ class CommandManager : public Singleton<CommandManager> { public: void execute(StringView command_line, Context& context, - ConstArrayView<String> shell_params = {}, - const EnvVarMap& env_vars = EnvVarMap{}); + const ShellContext& shell_context = ShellContext{}); Completions complete(const Context& context, CompletionFlags flags, StringView command_line, ByteCount cursor_pos); @@ -85,7 +88,9 @@ public: private: void execute_single_command(CommandParameters params, - Context& context, CharCoord pos) const; + Context& context, + const ShellContext& shell_context, + CharCoord pos) const; struct CommandDescriptor { @@ -104,8 +109,7 @@ private: }; String expand(StringView str, const Context& context, - ConstArrayView<String> shell_params = {}, - const EnvVarMap& env_vars = EnvVarMap{}); + const ShellContext& shell_context = ShellContext{}); } |
