0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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

@@ -872,13 +872,9 @@ diff_file(
(diff_flags & DIFF_ICASE) ? "-i " : "",
tmp_orig, tmp_new);
append_redir(cmd, (int)len, p_srr, tmp_diff);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
(void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT);
#ifdef FEAT_AUTOCMD
unblock_autocmds();
#endif
vim_free(cmd);
}
}
@@ -984,13 +980,9 @@ ex_diffpatch(exarg_T *eap)
* cooked mode to allow the user to respond to prompts. */
vim_snprintf((char *)buf, buflen, "patch -o %s %s < %s",
tmp_new, tmp_orig, esc_name);
#ifdef FEAT_AUTOCMD
block_autocmds(); /* Avoid ShellCmdPost stuff */
#endif
(void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
#ifdef FEAT_AUTOCMD
unblock_autocmds();
#endif
}
#ifdef UNIX
@@ -1052,11 +1044,9 @@ ex_diffpatch(exarg_T *eap)
eap->arg = newname;
ex_file(eap);
#ifdef FEAT_AUTOCMD
/* Do filetype detection with the new name. */
if (au_has_group((char_u *)"filetypedetect"))
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
#endif
}
}
}