diff options
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/fileio.c b/src/fileio.c index 6d1bbbc17..a06452fdb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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 @@ -8786,6 +8780,23 @@ ex_doautoall(eap) } /* + * 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 * one then use "aucmd_win". |