diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-02-12 20:14:01 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-02-12 20:14:01 +0100 |
commit | 60542ac9fd078d5f87fa5f91131432d8a316bb0f (patch) | |
tree | 662ab1896c75b1419af0d0c182df62a3cf1600bb /src/fileio.c | |
parent | bbc98db7c45ed9c8a6bbc7e2ac7c67180ccbab16 (diff) | |
download | vim-git-60542ac9fd078d5f87fa5f91131432d8a316bb0f.tar.gz |
updated for version 7.3.442v7.3.442
Problem: Still read modelines for ":doautocmd".
Solution: Move check for <nomodeline> to separate function.
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". |