From 7b1f313436c09d4e41ba71fa0ad91326c4e16944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 21 Apr 2016 08:41:13 +0200 Subject: vis: add infrastructure to register custom :-commands --- sam.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sam.c') diff --git a/sam.c b/sam.c index c52b2e1..7227438 100644 --- a/sam.c +++ b/sam.c @@ -109,6 +109,7 @@ static bool cmd_help(Vis*, Win*, Command*, const char *argv[], Cursor*, Filerang static bool cmd_map(Vis*, Win*, Command*, const char *argv[], Cursor*, Filerange*); static bool cmd_unmap(Vis*, Win*, Command*, const char *argv[], Cursor*, Filerange*); static bool cmd_langmap(Vis*, Win*, Command*, const char *argv[], Cursor*, Filerange*); +static bool cmd_user(Vis*, Win*, Command*, const char *argv[], Cursor*, Filerange*); /* command recognized at the ':'-prompt. commands are found using a unique * prefix match. that is if a command should be available under an abbreviation @@ -161,7 +162,10 @@ static const CommandDef cmds[] = { }; static const CommandDef cmddef_select = - { { "s" }, 0, NULL, cmd_select }; + { { NULL }, 0, NULL, cmd_select }; + +static const CommandDef cmddef_user = + { { NULL }, CMD_ARGV|CMD_FORCE|CMD_ONCE, NULL, cmd_user }; bool sam_init(Vis *vis) { if (!(vis->cmds = map_new())) -- cgit v1.2.3