diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-02-20 21:37:40 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-02-20 21:37:40 +0000 |
commit | faa959a8700219bd1726943cbb956001b5f737e4 (patch) | |
tree | 3cb74926336d18b833091edeb49c267ed5813394 /src/quickfix.c | |
parent | 70836c8ba83c180f978ed0ac92fb5ee78140a631 (diff) | |
download | vim-git-faa959a8700219bd1726943cbb956001b5f737e4.tar.gz |
updated for version 7.0202v7.0202
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 7243e1bdf..2ffce40a8 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2887,11 +2887,14 @@ ex_vimgrep(eap) int found_match; buf_T *first_match_buf = NULL; time_t seconds = 0; + int save_mls; #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) char_u *save_ei = NULL; - aco_save_T aco; #endif -#ifdef FEAT_AUTOCMD +#ifndef FEAT_AUTOCMD + buf_T *save_curbuf; +#else + aco_save_T aco; char_u *au_name = NULL; int flags = 0; colnr_T col; @@ -2999,11 +3002,15 @@ ex_vimgrep(eap) * indent scripts, a great speed improvement. */ save_ei = au_event_disable(",Filetype"); #endif + /* Don't use modelines here, it's useless. */ + save_mls = p_mls; + p_mls = 0; /* Load file into a buffer, so that 'fileencoding' is detected, * autocommands applied, etc. */ buf = load_dummy_buffer(fnames[fi]); + p_mls = save_mls; #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) au_event_restore(save_ei); #endif @@ -3089,19 +3096,30 @@ ex_vimgrep(eap) } } -#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) if (buf != NULL) { /* The buffer is still loaded, the Filetype autocommands - * need to be done now, in that buffer. And then the - * modelines need to be done (again). */ + * need to be done now, in that buffer. And the modelines + * need to be done (again). */ +#if defined(FEAT_AUTOCMD) aucmd_prepbuf(&aco, buf); +#else + save_curbuf = curbuf; + curbuf = buf; + curwin->w_buffer = curbuf; +#endif +#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, buf->b_fname, TRUE, buf); +#endif do_modelines(FALSE); +#if defined(FEAT_AUTOCMD) aucmd_restbuf(&aco); - } +#else + curbuf = save_curbuf; + curwin->w_buffer = curbuf; #endif + } } } } |