Mercurial > vim
comparison src/quickfix.c @ 717:2fa8cb05b861 v7.0218
updated for version 7.0218
author | vimboss |
---|---|
date | Wed, 08 Mar 2006 21:32:40 +0000 |
parents | 8ae24f338cab |
children | 3d0ca316efab |
comparison
equal
deleted
inserted
replaced
716:8ae24f338cab | 717:2fa8cb05b861 |
---|---|
3037 if (!got_int) | 3037 if (!got_int) |
3038 smsg((char_u *)_("Cannot open file \"%s\""), fnames[fi]); | 3038 smsg((char_u *)_("Cannot open file \"%s\""), fnames[fi]); |
3039 } | 3039 } |
3040 else | 3040 else |
3041 { | 3041 { |
3042 /* Try for a match in all lines of the buffer. | |
3043 * For ":1vimgrep" look for first match only. */ | |
3042 found_match = FALSE; | 3044 found_match = FALSE; |
3043 /* Try for a match in all lines of the buffer. */ | |
3044 for (lnum = 1; lnum <= buf->b_ml.ml_line_count && tomatch > 0; | 3045 for (lnum = 1; lnum <= buf->b_ml.ml_line_count && tomatch > 0; |
3045 ++lnum) | 3046 ++lnum) |
3046 { | 3047 { |
3047 /* For ":1vimgrep" look for multiple matches. */ | |
3048 col = 0; | 3048 col = 0; |
3049 while (vim_regexec_multi(®match, curwin, buf, lnum, | 3049 while (vim_regexec_multi(®match, curwin, buf, lnum, |
3050 col) > 0) | 3050 col) > 0) |
3051 { | 3051 { |
3052 if (qf_add_entry(qi, &prevp, | 3052 if (qf_add_entry(qi, &prevp, |
3091 /* Never keep a dummy buffer if there is another buffer | 3091 /* Never keep a dummy buffer if there is another buffer |
3092 * with the same name. */ | 3092 * with the same name. */ |
3093 wipe_dummy_buffer(buf); | 3093 wipe_dummy_buffer(buf); |
3094 buf = NULL; | 3094 buf = NULL; |
3095 } | 3095 } |
3096 else if (!buf_hide(buf)) | 3096 else if (!cmdmod.hide |
3097 || buf->b_p_bh[0] == 'u' /* "unload" */ | |
3098 || buf->b_p_bh[0] == 'w' /* "wipe" */ | |
3099 || buf->b_p_bh[0] == 'd') /* "delete" */ | |
3097 { | 3100 { |
3098 /* When not hiding the buffer and no match was found we | 3101 /* When no match was found we don't need to remember the |
3099 * don't need to remember the buffer, wipe it out. If | 3102 * buffer, wipe it out. If there was a match and it |
3100 * there was a match and it wasn't the first one or we | 3103 * wasn't the first one or we won't jump there: only |
3101 * won't jump there: only unload the buffer. */ | 3104 * unload the buffer. |
3105 * Ignore 'hidden' here, because it may lead to having too | |
3106 * many swap files. */ | |
3102 if (!found_match) | 3107 if (!found_match) |
3103 { | 3108 { |
3104 wipe_dummy_buffer(buf); | 3109 wipe_dummy_buffer(buf); |
3105 buf = NULL; | 3110 buf = NULL; |
3106 } | 3111 } |
3113 | 3118 |
3114 if (buf != NULL) | 3119 if (buf != NULL) |
3115 { | 3120 { |
3116 /* The buffer is still loaded, the Filetype autocommands | 3121 /* The buffer is still loaded, the Filetype autocommands |
3117 * need to be done now, in that buffer. And the modelines | 3122 * need to be done now, in that buffer. And the modelines |
3118 * need to be done (again). */ | 3123 * need to be done (again). But not the window-local |
3124 * options! */ | |
3119 #if defined(FEAT_AUTOCMD) | 3125 #if defined(FEAT_AUTOCMD) |
3120 aucmd_prepbuf(&aco, buf); | 3126 aucmd_prepbuf(&aco, buf); |
3121 #else | 3127 #else |
3122 save_curbuf = curbuf; | 3128 save_curbuf = curbuf; |
3123 curbuf = buf; | 3129 curbuf = buf; |
3125 #endif | 3131 #endif |
3126 #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) | 3132 #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) |
3127 apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, | 3133 apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, |
3128 buf->b_fname, TRUE, buf); | 3134 buf->b_fname, TRUE, buf); |
3129 #endif | 3135 #endif |
3130 do_modelines(FALSE); | 3136 do_modelines(OPT_NOWIN); |
3131 #if defined(FEAT_AUTOCMD) | 3137 #if defined(FEAT_AUTOCMD) |
3132 aucmd_restbuf(&aco); | 3138 aucmd_restbuf(&aco); |
3133 #else | 3139 #else |
3134 curbuf = save_curbuf; | 3140 curbuf = save_curbuf; |
3135 curwin->w_buffer = curbuf; | 3141 curwin->w_buffer = curbuf; |