1
0
forked from aniani/vim

patch 8.0.1564: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Graduate the +autocmd feature. Takes away 450 #ifdefs and
            increases code size of tiny Vim by only 40 Kbyte.
This commit is contained in:
Bram Moolenaar
2018-03-04 18:08:14 +01:00
parent 3f54fd319f
commit f2bd8ef2b4
48 changed files with 326 additions and 1157 deletions

View File

@@ -1099,10 +1099,8 @@ free_all_mem(void)
return;
entered_free_all_mem = TRUE;
# ifdef FEAT_AUTOCMD
/* Don't want to trigger autocommands from here on. */
block_autocmds();
# endif
/* Close all tabs and windows. Reset 'equalalways' to avoid redraws. */
p_ea = FALSE;
@@ -1157,9 +1155,7 @@ free_all_mem(void)
# endif
/* Obviously named calls. */
# if defined(FEAT_AUTOCMD)
free_all_autocmds();
# endif
clear_termcodes();
free_all_marks();
alist_clear(&global_alist);
@@ -3403,11 +3399,9 @@ vim_chdirfile(char_u *fname, char *trigger_autocmd UNUSED)
vim_strncpy(dir, fname, MAXPATHL - 1);
*gettail_sep(dir) = NUL;
res = mch_chdir((char *)dir) == 0 ? OK : FAIL;
#ifdef FEAT_AUTOCMD
if (res == OK && trigger_autocmd != NULL)
apply_autocmds(EVENT_DIRCHANGED, (char_u *)trigger_autocmd,
dir, FALSE, curbuf);
#endif
return res;
}
#endif