comparison src/quickfix.c @ 277:fe16c18c24a7

updated for version 7.0074
author vimboss
date Fri, 20 May 2005 21:25:31 +0000
parents 2463194c8cdd
children 33d9c918b8ab
comparison
equal deleted inserted replaced
276:b15976488069 277:fe16c18c24a7
490 /* 490 /*
491 * Extract error message data from matched line 491 * Extract error message data from matched line
492 */ 492 */
493 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */ 493 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
494 { 494 {
495 len = (int)(regmatch.endp[i] - regmatch.startp[i]); 495 int c = *regmatch.endp[i];
496 STRNCPY(namebuf, regmatch.startp[i], len); 496
497 namebuf[len] = NUL; 497 /* Expand ~/file and $HOME/file to full path. */
498 *regmatch.endp[i] = NUL;
499 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
500 *regmatch.endp[i] = c;
501
498 if (vim_strchr((char_u *)"OPQ", idx) != NULL 502 if (vim_strchr((char_u *)"OPQ", idx) != NULL
499 && mch_getperm(namebuf) == -1) 503 && mch_getperm(namebuf) == -1)
500 continue; 504 continue;
501 } 505 }
502 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */ 506 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
503 enr = (int)atol((char *)regmatch.startp[i]); 507 enr = (int)atol((char *)regmatch.startp[i]);
504 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */ 508 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
2786 /* 2790 /*
2787 * Populate the quickfix list with the items supplied in the list 2791 * Populate the quickfix list with the items supplied in the list
2788 * of dictionaries. 2792 * of dictionaries.
2789 */ 2793 */
2790 int 2794 int
2791 set_errorlist(list) 2795 set_errorlist(list, action)
2792 list_T *list; 2796 list_T *list;
2797 int action;
2793 { 2798 {
2794 listitem_T *li; 2799 listitem_T *li;
2795 dict_T *d; 2800 dict_T *d;
2796 char_u *filename, *pattern, *text, *type; 2801 char_u *filename, *pattern, *text, *type;
2797 long lnum; 2802 long lnum;
2799 int vcol; 2804 int vcol;
2800 qfline_T *prevp = NULL; 2805 qfline_T *prevp = NULL;
2801 int valid, status; 2806 int valid, status;
2802 int retval = OK; 2807 int retval = OK;
2803 2808
2804 /* make place for a new list */ 2809 if (action == ' ' || qf_curlist == qf_listcount)
2805 qf_new_list(); 2810 /* make place for a new list */
2811 qf_new_list();
2812 else if (action == 'a' && qf_lists[qf_curlist].qf_count > 0)
2813 /* Adding to existing list, find last entry. */
2814 for (prevp = qf_lists[qf_curlist].qf_start;
2815 prevp->qf_next != prevp; prevp = prevp->qf_next)
2816 ;
2817 else if (action == 'r')
2818 qf_free(qf_curlist);
2806 2819
2807 for (li = list->lv_first; li != NULL; li = li->li_next) 2820 for (li = list->lv_first; li != NULL; li = li->li_next)
2808 { 2821 {
2809 if (li->li_tv.v_type != VAR_DICT) 2822 if (li->li_tv.v_type != VAR_DICT)
2810 continue; /* Skip non-dict items */ 2823 continue; /* Skip non-dict items */