0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.1913

Problem:    When ":doautocmd" is used modelines are used even when no
            autocommands were executed. (Daniel Hahler)
Solution:   Skip processing modelines. (closes #854)
This commit is contained in:
Bram Moolenaar
2016-06-09 22:53:01 +02:00
parent 1cee693b31
commit 1610d05241
5 changed files with 20 additions and 9 deletions

View File

@@ -5449,9 +5449,11 @@ ex_doautocmd(exarg_T *eap)
{
char_u *arg = eap->arg;
int call_do_modelines = check_nomodeline(&arg);
int did_aucmd;
(void)do_doautocmd(arg, TRUE);
if (call_do_modelines) /* Only when there is no <nomodeline>. */
(void)do_doautocmd(arg, TRUE, &did_aucmd);
/* Only when there is no <nomodeline>. */
if (call_do_modelines && did_aucmd)
do_modelines(0);
}
#endif
@@ -11896,7 +11898,7 @@ ex_filetype(exarg_T *eap)
}
if (*arg == 'd')
{
(void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE);
(void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE, NULL);
do_modelines(0);
}
}