diff src/ex_docmd.c @ 3350:198ec1fff71a v7.3.442

updated for version 7.3.442 Problem: Still read modelines for ":doautocmd". Solution: Move check for <nomodeline> to separate function.
author Bram Moolenaar <bram@vim.org>
date Sun, 12 Feb 2012 20:14:01 +0100
parents f4574729f6df
children 7e4428115d2c
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4955,7 +4955,7 @@ ex_abclear(eap)
     map_clear(eap->cmd, eap->arg, TRUE, TRUE);
 }
 
-#ifdef FEAT_AUTOCMD
+#if defined(FEAT_AUTOCMD) || defined(PROTO)
     static void
 ex_autocmd(eap)
     exarg_T	*eap;
@@ -4982,8 +4982,12 @@ ex_autocmd(eap)
 ex_doautocmd(eap)
     exarg_T	*eap;
 {
-    (void)do_doautocmd(eap->arg, TRUE);
-    do_modelines(0);
+    char_u	*arg = eap->arg;
+    int		call_do_modelines = check_nomodeline(&arg);
+
+    (void)do_doautocmd(arg, TRUE);
+    if (call_do_modelines)  /* Only when there is no <nomodeline>. */
+	do_modelines(0);
 }
 #endif