Mercurial > vim
comparison src/if_cscope.c @ 1027:c37ed44f014f v7.0.153
updated for version 7.0-153
author | vimboss |
---|---|
date | Mon, 30 Oct 2006 21:32:28 +0000 |
parents | b2dcb8457067 |
children | 65e0c2e3a352 |
comparison
equal
deleted
inserted
replaced
1026:d8af28dbfb80 | 1027:c37ed44f014f |
---|---|
1098 } | 1098 } |
1099 } | 1099 } |
1100 if (qfpos != NULL && *qfpos != '0' && totmatches > 0) | 1100 if (qfpos != NULL && *qfpos != '0' && totmatches > 0) |
1101 { | 1101 { |
1102 /* fill error list */ | 1102 /* fill error list */ |
1103 FILE *f; | 1103 FILE *f; |
1104 char_u *tmp = vim_tempname('c'); | 1104 char_u *tmp = vim_tempname('c'); |
1105 qf_info_T *qi = NULL; | 1105 qf_info_T *qi = NULL; |
1106 win_T *wp = NULL; | 1106 win_T *wp = NULL; |
1107 | 1107 |
1108 f = mch_fopen((char *)tmp, "w"); | 1108 f = mch_fopen((char *)tmp, "w"); |
1109 cs_file_results(f, nummatches); | 1109 if (f == NULL) |
1110 fclose(f); | 1110 EMSG2(_(e_notopen), tmp); |
1111 if (use_ll) /* Use location list */ | 1111 else |
1112 wp = curwin; | 1112 { |
1113 /* '-' starts a new error list */ | 1113 cs_file_results(f, nummatches); |
1114 if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0) | 1114 fclose(f); |
1115 { | 1115 if (use_ll) /* Use location list */ |
1116 wp = curwin; | |
1117 /* '-' starts a new error list */ | |
1118 if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", | |
1119 *qfpos == '-') > 0) | |
1120 { | |
1116 # ifdef FEAT_WINDOWS | 1121 # ifdef FEAT_WINDOWS |
1117 if (postponed_split != 0) | 1122 if (postponed_split != 0) |
1118 { | 1123 { |
1119 win_split(postponed_split > 0 ? postponed_split : 0, | 1124 win_split(postponed_split > 0 ? postponed_split : 0, |
1120 postponed_split_flags); | 1125 postponed_split_flags); |
1121 # ifdef FEAT_SCROLLBIND | 1126 # ifdef FEAT_SCROLLBIND |
1122 curwin->w_p_scb = FALSE; | 1127 curwin->w_p_scb = FALSE; |
1123 # endif | 1128 # endif |
1124 postponed_split = 0; | 1129 postponed_split = 0; |
1130 } | |
1131 # endif | |
1132 if (use_ll) | |
1133 /* | |
1134 * In the location list window, use the displayed location | |
1135 * list. Otherwise, use the location list for the window. | |
1136 */ | |
1137 qi = (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) | |
1138 ? wp->w_llist_ref : wp->w_llist; | |
1139 qf_jump(qi, 0, 0, forceit); | |
1125 } | 1140 } |
1126 # endif | |
1127 if (use_ll) | |
1128 /* | |
1129 * In the location list window, use the displayed location | |
1130 * list. Otherwise, use the location list for the window. | |
1131 */ | |
1132 qi = (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) ? | |
1133 wp->w_llist_ref : wp->w_llist; | |
1134 qf_jump(qi, 0, 0, forceit); | |
1135 } | 1141 } |
1136 mch_remove(tmp); | 1142 mch_remove(tmp); |
1137 vim_free(tmp); | 1143 vim_free(tmp); |
1138 return TRUE; | 1144 return TRUE; |
1139 } | 1145 } |
1721 if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx, | 1727 if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx, |
1722 &slno, &search)) == NULL) | 1728 &slno, &search)) == NULL) |
1723 continue; | 1729 continue; |
1724 | 1730 |
1725 context = (char *)alloc((unsigned)strlen(cntx)+5); | 1731 context = (char *)alloc((unsigned)strlen(cntx)+5); |
1726 if (context==NULL) | 1732 if (context == NULL) |
1727 continue; | 1733 continue; |
1728 | 1734 |
1729 if (strcmp(cntx, "<global>")==0) | 1735 if (strcmp(cntx, "<global>")==0) |
1730 strcpy(context, "<<global>>"); | 1736 strcpy(context, "<<global>>"); |
1731 else | 1737 else |
1732 sprintf(context, "<<%s>>", cntx); | 1738 sprintf(context, "<<%s>>", cntx); |
1733 | 1739 |
1734 if (search==NULL) | 1740 if (search == NULL) |
1735 fprintf(f, "%s\t%s\t%s\n", fullname, slno, context); | 1741 fprintf(f, "%s\t%s\t%s\n", fullname, slno, context); |
1736 else | 1742 else |
1737 fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search); | 1743 fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search); |
1738 | 1744 |
1739 vim_free(context); | 1745 vim_free(context); |