summaryrefslogtreecommitdiff
path: root/src/command.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-01-23 21:56:39 +0100
committerAlbert Cervin <albert@acervin.com>2023-01-23 21:56:39 +0100
commit9eda570311ffd292d333f7687074403ff46cc838 (patch)
tree40265e3d2c23831afaf352bb64b8d6634bae9730 /src/command.h
parent385c9d62a5507d901ff7e54d7a4c0342cf3aff43 (diff)
downloaddged-9eda570311ffd292d333f7687074403ff46cc838.tar.gz
dged-9eda570311ffd292d333f7687074403ff46cc838.tar.xz
dged-9eda570311ffd292d333f7687074403ff46cc838.zip
Implement some more commands
- More bug fixes for keys: You can now have mod-less keys in keymaps as binds. - Fix calculation bug with space fillouts.
Diffstat (limited to 'src/command.h')
-rw-r--r--src/command.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/command.h b/src/command.h
index fe998ae..719422e 100644
--- a/src/command.h
+++ b/src/command.h
@@ -1,9 +1,14 @@
#include <stdint.h>
struct buffer;
+struct buffers;
+struct window;
struct command_ctx {
- struct buffer *current_buffer;
+ struct buffers *buffers;
+ struct window *active_window;
+ struct commands *commands;
+ struct command *self;
void *userdata;
};
@@ -34,7 +39,8 @@ uint32_t register_command(struct commands *commands, struct command *command);
void register_commands(struct commands *command_list, struct command *commands,
uint32_t ncommands);
-int32_t execute_command(struct command *command, struct buffer *current_buffer,
+int32_t execute_command(struct command *command, struct commands *commands,
+ struct window *active_window, struct buffers *buffers,
int argc, const char *argv[]);
uint32_t hash_command_name(const char *name);
@@ -42,3 +48,8 @@ uint32_t hash_command_name(const char *name);
struct command *lookup_command(struct commands *commands, const char *name);
struct command *lookup_command_by_hash(struct commands *commands,
uint32_t hash);
+
+// Common commands
+int32_t find_file(struct command_ctx ctx, int argc, const char *argv[]);
+int32_t run_interactive(struct command_ctx ctx, int argc, const char *argv[]);
+int32_t switch_buffer(struct command_ctx ctx, int argc, const char *argv[]);