Mercurial > vim
comparison src/fileio.c @ 6154:67edf731a240 v7.4.414
updated for version 7.4.414
Problem: Cannot define a command only when it's used.
Solution: Add the CmdUndefined autocommand event. (partly by Yasuhiro
Matsumoto)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 22 Aug 2014 23:05:54 +0200 |
parents | 86fb698a38d5 |
children | 52fa8300ce20 |
comparison
equal
deleted
inserted
replaced
6153:1e8ebf870720 | 6154:67edf731a240 |
---|---|
7639 {"BufWritePost", EVENT_BUFWRITEPOST}, | 7639 {"BufWritePost", EVENT_BUFWRITEPOST}, |
7640 {"BufWritePre", EVENT_BUFWRITEPRE}, | 7640 {"BufWritePre", EVENT_BUFWRITEPRE}, |
7641 {"BufWriteCmd", EVENT_BUFWRITECMD}, | 7641 {"BufWriteCmd", EVENT_BUFWRITECMD}, |
7642 {"CmdwinEnter", EVENT_CMDWINENTER}, | 7642 {"CmdwinEnter", EVENT_CMDWINENTER}, |
7643 {"CmdwinLeave", EVENT_CMDWINLEAVE}, | 7643 {"CmdwinLeave", EVENT_CMDWINLEAVE}, |
7644 {"CmdUndefined", EVENT_CMDUNDEFINED}, | |
7644 {"ColorScheme", EVENT_COLORSCHEME}, | 7645 {"ColorScheme", EVENT_COLORSCHEME}, |
7645 {"CompleteDone", EVENT_COMPLETEDONE}, | 7646 {"CompleteDone", EVENT_COMPLETEDONE}, |
7646 {"CursorHold", EVENT_CURSORHOLD}, | 7647 {"CursorHold", EVENT_CURSORHOLD}, |
7647 {"CursorHoldI", EVENT_CURSORHOLDI}, | 7648 {"CursorHoldI", EVENT_CURSORHOLDI}, |
7648 {"CursorMoved", EVENT_CURSORMOVED}, | 7649 {"CursorMoved", EVENT_CURSORMOVED}, |
9157 has_insertcharpre() | 9158 has_insertcharpre() |
9158 { | 9159 { |
9159 return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL); | 9160 return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL); |
9160 } | 9161 } |
9161 | 9162 |
9163 /* | |
9164 * Return TRUE when there is an CmdUndefined autocommand defined. | |
9165 */ | |
9166 int | |
9167 has_cmdundefined() | |
9168 { | |
9169 return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL); | |
9170 } | |
9171 | |
9172 /* | |
9173 * Return TRUE when there is an FuncUndefined autocommand defined. | |
9174 */ | |
9175 int | |
9176 has_funcundefined() | |
9177 { | |
9178 return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL); | |
9179 } | |
9180 | |
9162 static int | 9181 static int |
9163 apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) | 9182 apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) |
9164 event_T event; | 9183 event_T event; |
9165 char_u *fname; /* NULL or empty means use actual file name */ | 9184 char_u *fname; /* NULL or empty means use actual file name */ |
9166 char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means | 9185 char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means |