summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-11-26 18:32:57 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-11-26 18:32:57 +0000
commit957446dee480ddd3cc4454a60b718bda35d9dbf6 (patch)
tree72e72c70e223af766dfc54512759f4055fbd35c9 /src/command_manager.hh
parent417802cbdfaa06bb3071fd648ad0536b64fcda21 (diff)
Add a Context parameter to commands
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh
index c3d5fca4..852c7d67 100644
--- a/src/command_manager.hh
+++ b/src/command_manager.hh
@@ -13,13 +13,16 @@
namespace Kakoune
{
+struct Context;
+
struct wrong_argument_count : runtime_error
{
wrong_argument_count() : runtime_error("wrong argument count") {}
};
typedef std::vector<std::string> CommandParameters;
-typedef std::function<void (const CommandParameters&)> Command;
+typedef std::function<void (const CommandParameters&,
+ const Context& context)> Command;
typedef std::function<CandidateList (const CommandParameters&,
size_t, size_t)> CommandCompleter;
@@ -50,7 +53,10 @@ private:
class CommandManager : public Singleton<CommandManager>
{
public:
- void execute(const std::string& command_line);
+ void execute(const std::string& command_line, const Context& context);
+ void execute(const std::string& command, const CommandParameters& params,
+ const Context& context);
+
Completions complete(const std::string& command_line, size_t cursor_pos);
void register_command(const std::string& command_name,