aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJurica Bradarić <jbradaric@users.noreply.github.com>2016-09-04 23:43:41 +0200
committerJustin M. Keyes <justinkz@gmail.com>2016-09-04 23:43:41 +0200
commit73b8424fad108d1ae5981f7fad32f12df35fef2e (patch)
treeadc84aa82a17afe6464064ab11e2fa5b1170c62c /src/nvim/ex_docmd.c
parent0f381f26cbbe7f50de106c996d8a9d946db61574 (diff)
downloadrneovim-73b8424fad108d1ae5981f7fad32f12df35fef2e.tar.gz
rneovim-73b8424fad108d1ae5981f7fad32f12df35fef2e.tar.bz2
rneovim-73b8424fad108d1ae5981f7fad32f12df35fef2e.zip
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) https://github.com/vim/vim/commit/1610d052413e0ed664498853a47acc2d677a22d1
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 967c4fc5b4..e3ca177029 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -4364,12 +4364,15 @@ static void ex_autocmd(exarg_T *eap)
*/
static void ex_doautocmd(exarg_T *eap)
{
- char_u *arg = eap->arg;
+ char_u *arg = eap->arg;
int call_do_modelines = check_nomodeline(&arg);
+ bool 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);
+ }
}
/*
@@ -9464,7 +9467,7 @@ static void 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);
}
} else if (STRCMP(arg, "off") == 0) {