1
0
forked from aniani/vim

updated for version 7.3.442

Problem:    Still read modelines for ":doautocmd".
Solution:   Move check for <nomodeline> to separate function.
This commit is contained in:
Bram Moolenaar
2012-02-12 20:14:01 +01:00
parent bbc98db7c4
commit 60542ac9fd
5 changed files with 36 additions and 16 deletions

View File

@@ -8740,13 +8740,7 @@ ex_doautoall(eap)
aco_save_T aco;
buf_T *buf;
char_u *arg = eap->arg;
int call_do_modelines = TRUE;
if (STRNCMP(arg, "<nomodeline>", 12) == 0)
{
call_do_modelines = FALSE;
arg = skipwhite(arg + 12);
}
int call_do_modelines = check_nomodeline(&arg);
/*
* This is a bit tricky: For some commands curwin->w_buffer needs to be
@@ -8785,6 +8779,23 @@ ex_doautoall(eap)
check_cursor(); /* just in case lines got deleted */
}
/*
* Check *argp for <nomodeline>. When it is present return FALSE, otherwise
* return TRUE and advance *argp to after it.
* Thus return TRUE when do_modelines() should be called.
*/
int
check_nomodeline(argp)
char_u **argp;
{
if (STRNCMP(*argp, "<nomodeline>", 12) == 0)
{
*argp = skipwhite(*argp + 12);
return FALSE;
}
return TRUE;
}
/*
* Prepare for executing autocommands for (hidden) buffer "buf".
* Search for a visible window containing the current buffer. If there isn't