comparison src/quickfix.c @ 647:19106f131c87 v7.0188

updated for version 7.0188
author vimboss
date Thu, 26 Jan 2006 22:25:15 +0000
parents e4fa26ce8769
children 9032e4668296
comparison
equal deleted inserted replaced
646:eeda7c3124c5 647:19106f131c87
3246 #if defined(FEAT_EVAL) || defined(PROTO) 3246 #if defined(FEAT_EVAL) || defined(PROTO)
3247 /* 3247 /*
3248 * Add each quickfix error to list "list" as a dictionary. 3248 * Add each quickfix error to list "list" as a dictionary.
3249 */ 3249 */
3250 int 3250 int
3251 get_errorlist(list) 3251 get_errorlist(wp, list)
3252 win_T *wp;
3252 list_T *list; 3253 list_T *list;
3253 { 3254 {
3254 qf_info_T *qi = &ql_info; 3255 qf_info_T *qi = &ql_info;
3255 dict_T *dict; 3256 dict_T *dict;
3256 char_u buf[2]; 3257 char_u buf[2];
3257 qfline_T *qfp; 3258 qfline_T *qfp;
3258 int i; 3259 int i;
3260
3261 if (wp != NULL)
3262 {
3263 qi = GET_LOC_LIST(wp);
3264 if (qi == NULL)
3265 return FAIL;
3266 }
3259 3267
3260 if (qi->qf_curlist >= qi->qf_listcount 3268 if (qi->qf_curlist >= qi->qf_listcount
3261 || qi->qf_lists[qi->qf_curlist].qf_count == 0) 3269 || qi->qf_lists[qi->qf_curlist].qf_count == 0)
3262 return FAIL; 3270 return FAIL;
3263 3271
3290 /* 3298 /*
3291 * Populate the quickfix list with the items supplied in the list 3299 * Populate the quickfix list with the items supplied in the list
3292 * of dictionaries. 3300 * of dictionaries.
3293 */ 3301 */
3294 int 3302 int
3295 set_errorlist(list, action) 3303 set_errorlist(wp, list, action)
3304 win_T *wp;
3296 list_T *list; 3305 list_T *list;
3297 int action; 3306 int action;
3298 { 3307 {
3299 listitem_T *li; 3308 listitem_T *li;
3300 dict_T *d; 3309 dict_T *d;
3304 int vcol; 3313 int vcol;
3305 qfline_T *prevp = NULL; 3314 qfline_T *prevp = NULL;
3306 int valid, status; 3315 int valid, status;
3307 int retval = OK; 3316 int retval = OK;
3308 qf_info_T *qi = &ql_info; 3317 qf_info_T *qi = &ql_info;
3318
3319 if (wp != NULL)
3320 {
3321 qi = ll_get_or_alloc_list(curwin);
3322 if (qi == NULL)
3323 return FAIL;
3324 }
3309 3325
3310 if (action == ' ' || qi->qf_curlist == qi->qf_listcount) 3326 if (action == ' ' || qi->qf_curlist == qi->qf_listcount)
3311 /* make place for a new list */ 3327 /* make place for a new list */
3312 qf_new_list(qi); 3328 qf_new_list(qi);
3313 else if (action == 'a' && qi->qf_lists[qi->qf_curlist].qf_count > 0) 3329 else if (action == 'a' && qi->qf_lists[qi->qf_curlist].qf_count > 0)