vim-patch:7.4.1913 (#5260)

Problem:    When ":doautocmd" is used modelines are used even when no
            autocommands were executed. (Daniel Hahler)
Solution:   Skip processing modelines. (closes vim/vim#854)

1610d05241
This commit is contained in:
Jurica Bradarić
2016-09-04 23:43:41 +02:00
committed by Justin M. Keyes
parent 0f381f26cb
commit 73b8424fad
4 changed files with 33 additions and 19 deletions

View File

@@ -1711,11 +1711,11 @@ int do_write(exarg_T *eap)
goto theend;
}
/* If 'filetype' was empty try detecting it now. */
// If 'filetype' was empty try detecting it now.
if (*curbuf->b_p_ft == NUL) {
if (au_has_group((char_u *)"filetypedetect"))
(void)do_doautocmd((char_u *)"filetypedetect BufRead",
TRUE);
if (au_has_group((char_u *)"filetypedetect")) {
(void)do_doautocmd((char_u *)"filetypedetect BufRead", true, NULL);
}
do_modelines(0);
}