aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-11-11 12:46:08 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-11-11 12:46:08 -0500
commitb1e06c6d60f4947794851982eb73db6ef3b64fbf (patch)
tree22feb7e133de02452e2dc437d9152b34a13376c8 /src/nvim/fileio.c
parentb027e1ed0c92ed49961ecbd24228967d916c2bbd (diff)
parentbffea01c89bfe2c93169f65b50653d63dcb8e035 (diff)
downloadrneovim-b1e06c6d60f4947794851982eb73db6ef3b64fbf.tar.gz
rneovim-b1e06c6d60f4947794851982eb73db6ef3b64fbf.tar.bz2
rneovim-b1e06c6d60f4947794851982eb73db6ef3b64fbf.zip
Merge pull request #1282 from splinterofchaos/cmd-undef
vim-patch:7.4.414 + vim-patch:7.4.415
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 05a0a59874..b20150b2c9 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
@@ -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,