Mercurial > vim
comparison src/quickfix.c @ 661:e93a99ef31d0
updated for version 7.0195
author | vimboss |
---|---|
date | Thu, 09 Feb 2006 23:53:20 +0000 |
parents | d6a69271cb9a |
children | 21ab9abf0f08 |
comparison
equal
deleted
inserted
replaced
660:13296f8d1d3d | 661:e93a99ef31d0 |
---|---|
2573 */ | 2573 */ |
2574 int | 2574 int |
2575 grep_internal(cmdidx) | 2575 grep_internal(cmdidx) |
2576 cmdidx_T cmdidx; | 2576 cmdidx_T cmdidx; |
2577 { | 2577 { |
2578 return ((cmdidx == CMD_grep || cmdidx == CMD_lgrep | 2578 return ((cmdidx == CMD_grep |
2579 || cmdidx == CMD_grepadd || cmdidx == CMD_lgrepadd) | 2579 || cmdidx == CMD_lgrep |
2580 || cmdidx == CMD_grepadd | |
2581 || cmdidx == CMD_lgrepadd) | |
2580 && STRCMP("internal", | 2582 && STRCMP("internal", |
2581 *curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0); | 2583 *curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0); |
2582 } | 2584 } |
2583 | 2585 |
2584 /* | 2586 /* |
2596 #ifdef FEAT_AUTOCMD | 2598 #ifdef FEAT_AUTOCMD |
2597 char_u *au_name = NULL; | 2599 char_u *au_name = NULL; |
2598 | 2600 |
2599 switch (eap->cmdidx) | 2601 switch (eap->cmdidx) |
2600 { | 2602 { |
2601 case CMD_make: au_name = (char_u *)"make"; break; | 2603 case CMD_make: au_name = (char_u *)"make"; break; |
2602 case CMD_lmake: au_name = (char_u *)"lmake"; break; | 2604 case CMD_lmake: au_name = (char_u *)"lmake"; break; |
2603 case CMD_grep: au_name = (char_u *)"grep"; break; | 2605 case CMD_grep: au_name = (char_u *)"grep"; break; |
2604 case CMD_lgrep: au_name = (char_u *)"lgrep"; break; | 2606 case CMD_lgrep: au_name = (char_u *)"lgrep"; break; |
2605 case CMD_grepadd: au_name = (char_u *)"grepadd"; break; | 2607 case CMD_grepadd: au_name = (char_u *)"grepadd"; break; |
2606 case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break; | 2608 case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break; |
2607 default: break; | 2609 default: break; |
2608 } | 2610 } |
2609 if (au_name != NULL) | 2611 if (au_name != NULL) |
2610 { | 2612 { |
2611 apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, | 2613 apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, |
2906 if (did_throw || force_abort) | 2908 if (did_throw || force_abort) |
2907 return; | 2909 return; |
2908 } | 2910 } |
2909 #endif | 2911 #endif |
2910 | 2912 |
2911 if (eap->cmdidx == CMD_grep | 2913 if (eap->cmdidx == CMD_lgrep |
2912 || eap->cmdidx == CMD_lvimgrep | 2914 || eap->cmdidx == CMD_lvimgrep |
2913 || eap->cmdidx == CMD_lgrepadd | 2915 || eap->cmdidx == CMD_lgrepadd |
2914 || eap->cmdidx == CMD_lvimgrepadd) | 2916 || eap->cmdidx == CMD_lvimgrepadd) |
2915 { | 2917 { |
2916 qi = ll_get_or_alloc_list(curwin); | 2918 qi = ll_get_or_alloc_list(curwin); |
2937 { | 2939 { |
2938 EMSG(_("E683: File name missing or invalid pattern")); | 2940 EMSG(_("E683: File name missing or invalid pattern")); |
2939 goto theend; | 2941 goto theend; |
2940 } | 2942 } |
2941 | 2943 |
2942 if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd && | 2944 if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd && |
2943 eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd) | 2945 eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd) |
2944 || qi->qf_curlist == qi->qf_listcount) | 2946 || qi->qf_curlist == qi->qf_listcount) |
2945 /* make place for a new list */ | 2947 /* make place for a new list */ |
2946 qf_new_list(qi); | 2948 qf_new_list(qi); |
2947 else if (qi->qf_lists[qi->qf_curlist].qf_count > 0) | 2949 else if (qi->qf_lists[qi->qf_curlist].qf_count > 0) |
3474 } | 3476 } |
3475 if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count | 3477 if (eap->line1 < 1 || eap->line1 > buf->b_ml.ml_line_count |
3476 || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) | 3478 || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) |
3477 EMSG(_(e_invrange)); | 3479 EMSG(_(e_invrange)); |
3478 else | 3480 else |
3479 qf_init_ext(qi, NULL, buf, NULL, p_efm, | 3481 { |
3480 (eap->cmdidx == CMD_cbuffer | 3482 int buffer_cmd = (eap->cmdidx == CMD_cbuffer |
3481 || eap->cmdidx == CMD_lbuffer), | 3483 || eap->cmdidx == CMD_lbuffer); |
3482 eap->line1, eap->line2); | 3484 |
3485 if (qf_init_ext(qi, NULL, buf, NULL, p_efm, buffer_cmd, | |
3486 eap->line1, eap->line2) > 0 | |
3487 && buffer_cmd) | |
3488 qf_jump(qi, 0, 0, eap->forceit); /* display first error */ | |
3489 } | |
3483 } | 3490 } |
3484 } | 3491 } |
3485 | 3492 |
3486 #if defined(FEAT_EVAL) || defined(PROTO) | 3493 #if defined(FEAT_EVAL) || defined(PROTO) |
3487 /* | 3494 /* |
3671 EMSG2(_(e_nomatch2), eap->arg); | 3678 EMSG2(_(e_nomatch2), eap->arg); |
3672 | 3679 |
3673 if (eap->cmdidx == CMD_lhelpgrep) | 3680 if (eap->cmdidx == CMD_lhelpgrep) |
3674 { | 3681 { |
3675 /* If the help window is not opened or if it already points to the | 3682 /* If the help window is not opened or if it already points to the |
3676 * correct location list, then free the new location list | 3683 * correct location list, then free the new location list. */ |
3677 */ | |
3678 if (!curwin->w_buffer->b_help || curwin->w_llist == qi) | 3684 if (!curwin->w_buffer->b_help || curwin->w_llist == qi) |
3679 { | 3685 { |
3680 if (new_qi) | 3686 if (new_qi) |
3681 ll_free_all(&qi); | 3687 ll_free_all(&qi); |
3682 } | 3688 } |