From 8390accde7e37f1531b250ec2144b8d16cdee198 Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Fri, 10 Oct 2014 21:54:10 -0400 Subject: Fix fileio.c's diagram. --- src/nvim/fileio.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 05a0a59874..4486d43578 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -72,25 +72,25 @@ * The result is an array of Autopat lists, which point to AutoCmd lists: * * first_autopat[0] --> Autopat.next --> Autopat.next --> NULL - * Autopat.cmds Autopat.cmds - * | | - * V V - * AutoCmd.next AutoCmd.next - * | | - * V V - * AutoCmd.next NULL - * | - * V - * NULL + * Autopat.cmds Autopat.cmds + * | | + * V V + * AutoCmd.next AutoCmd.next + * | | + * V V + * AutoCmd.next NULL + * | + * V + * NULL * * first_autopat[1] --> Autopat.next --> NULL - * Autopat.cmds - * | - * V - * AutoCmd.next - * | - * V - * NULL + * Autopat.cmds + * | + * V + * AutoCmd.next + * | + * V + * NULL * etc. * * The order of AutoCmds is important, this is the order in which they were -- cgit From 0051a7cb259f2b88e01b9efe92580aafc970fbe4 Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Fri, 10 Oct 2014 21:51:25 -0400 Subject: vim-patch:7.4.414 Problem: Cannot define a command only when it's used. Solution: Add the CmdUndefined autocommand event. (partly by Yasuhiro Matsumoto) https://code.google.com/p/vim/source/detail?r=v7-4-414 --- src/nvim/fileio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/fileio.c') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 4486d43578..b20150b2c9 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5198,6 +5198,7 @@ static struct event_name { {"BufWriteCmd", EVENT_BUFWRITECMD}, {"CmdwinEnter", EVENT_CMDWINENTER}, {"CmdwinLeave", EVENT_CMDWINLEAVE}, + {"CmdUndefined", EVENT_CMDUNDEFINED}, {"ColorScheme", EVENT_COLORSCHEME}, {"CompleteDone", EVENT_COMPLETEDONE}, {"CursorHold", EVENT_CURSORHOLD}, @@ -6462,6 +6463,18 @@ int has_insertcharpre(void) return first_autopat[(int)EVENT_INSERTCHARPRE] != NULL; } +/// @returns true when there is an CmdUndefined autocommand defined. +int has_cmdundefined(void) +{ + return first_autopat[(int)EVENT_CMDUNDEFINED] != NULL; +} + +/// @returns true when there is an FuncUndefined autocommand defined. +int has_funcundefined(void) +{ + return first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL; +} + static int apply_autocmds_group ( event_T event, -- cgit