aboutsummaryrefslogtreecommitdiff
path: root/vis.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-21 08:41:13 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-21 10:01:40 +0200
commit7b1f313436c09d4e41ba71fa0ad91326c4e16944 (patch)
tree3c8e3f30bd2237f337541b3d16c2ef1d22f09914 /vis.h
parent59b883431996e4d52d74d8926bc48243ec9dc8be (diff)
downloadvis-7b1f313436c09d4e41ba71fa0ad91326c4e16944.tar.gz
vis-7b1f313436c09d4e41ba71fa0ad91326c4e16944.tar.xz
vis: add infrastructure to register custom :-commands
Diffstat (limited to 'vis.h')
-rw-r--r--vis.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vis.h b/vis.h
index 6f60e6a..69b2586 100644
--- a/vis.h
+++ b/vis.h
@@ -396,6 +396,14 @@ void vis_cancel(Vis*);
/* execute a :-command (including an optinal range specifier) */
bool vis_cmd(Vis*, const char *cmd);
+
+/* type of user defined function which can be registered */
+typedef bool (*CmdFunc)(Vis*, Win*, void *data, bool force,
+ const char *argv[], Cursor*, Filerange*);
+/* the function will be invoked whenever a command which matches a
+ * unique prefix of the given name is executed */
+bool vis_cmd_register(Vis*, const char *name, void *data, CmdFunc);
+bool vis_cmd_unregister(Vis*, const char *name);
/* execute any kind (:,?,/) of prompt command */
bool vis_prompt_cmd(Vis*, const char *cmd);